diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-09-02 14:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 14:42:51 +0200 |
commit | 5ff5424d8c81c7123d8656a787af2ff85b3dec21 (patch) | |
tree | 322929ee01d892bb3c927e7fe1238369c647f820 /inc/Cache/CacheParser.php | |
parent | 0613df3287b82a98b1e97cf86ed9d4c8fbd16f1c (diff) | |
parent | 91560755291852b8302767d454183a7662666f7e (diff) | |
download | dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.tar.gz dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.zip |
Merge pull request #4045 from dokuwiki/autofix
Use Rector to autofix code smell
Diffstat (limited to 'inc/Cache/CacheParser.php')
-rw-r--r-- | inc/Cache/CacheParser.php | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/inc/Cache/CacheParser.php b/inc/Cache/CacheParser.php index 4d8550dbe..d885d256b 100644 --- a/inc/Cache/CacheParser.php +++ b/inc/Cache/CacheParser.php @@ -7,7 +7,6 @@ namespace dokuwiki\Cache; */ class CacheParser extends Cache { - public $file = ''; // source file for cache public $mode = ''; // input mode (represents the processing the input file will undergo) public $page = ''; @@ -35,32 +34,30 @@ class CacheParser extends Cache /** * method contains cache use decision logic * - * @return bool see useCache() + * @return bool see useCache() */ public function makeDefaultCacheDecision() { - if (!file_exists($this->file)) { + // source doesn't exist return false; - } // source exists? + } return parent::makeDefaultCacheDecision(); } protected function addDependencies() { - // parser cache file dependencies ... - $files = array( - $this->file, // ... source - DOKU_INC . 'inc/Parsing/Parser.php', // ... parser - DOKU_INC . 'inc/parser/handler.php', // ... handler - ); - $files = array_merge($files, getConfigFiles('main')); // ... wiki settings - - $this->depends['files'] = !empty($this->depends['files']) ? - array_merge($files, $this->depends['files']) : - $files; + $files = [ + $this->file, // source + DOKU_INC . 'inc/Parsing/Parser.php', // parser + DOKU_INC . 'inc/parser/handler.php', // handler + ]; + $files = array_merge($files, getConfigFiles('main')); // wiki settings + + $this->depends['files'] = empty($this->depends['files']) ? + $files : + array_merge($files, $this->depends['files']); parent::addDependencies(); } - } |