diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-08-29 18:14:40 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2023-08-29 18:14:40 +0200 |
commit | bcaec9f47d06126b3e653fea89a86d8b6a6cbef8 (patch) | |
tree | 16cc1b9d4f53736f1dddbd094c4621b34d0dcbbc /inc/Parsing/Lexer/ParallelRegex.php | |
parent | faf3f01b9af152b16aca96437c109c41b8250689 (diff) | |
download | dokuwiki-bcaec9f47d06126b3e653fea89a86d8b6a6cbef8.tar.gz dokuwiki-bcaec9f47d06126b3e653fea89a86d8b6a6cbef8.zip |
Apply rector fixes to inc/Parsing
Diffstat (limited to 'inc/Parsing/Lexer/ParallelRegex.php')
-rw-r--r-- | inc/Parsing/Lexer/ParallelRegex.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/inc/Parsing/Lexer/ParallelRegex.php b/inc/Parsing/Lexer/ParallelRegex.php index bf1979950..cc47c2e9b 100644 --- a/inc/Parsing/Lexer/ParallelRegex.php +++ b/inc/Parsing/Lexer/ParallelRegex.php @@ -17,9 +17,9 @@ namespace dokuwiki\Parsing\Lexer; class ParallelRegex { /** @var string[] patterns to match */ - protected $patterns; + protected $patterns = []; /** @var string[] labels for above patterns */ - protected $labels; + protected $labels = []; /** @var string the compound regex matching all patterns */ protected $regex; /** @var bool case sensitive matching? */ @@ -34,9 +34,6 @@ class ParallelRegex public function __construct($case) { $this->case = $case; - $this->patterns = array(); - $this->labels = array(); - $this->regex = null; } /** @@ -121,15 +118,15 @@ class ParallelRegex } } - $split = array($subject, "", ""); + $split = [$subject, "", ""]; return false; } $idx = count($matches)-2; - list($pre, $post) = preg_split($this->patterns[$idx].$this->getPerlMatchingFlags(), $subject, 2); - $split = array($pre, $matches[0], $post); + [$pre, $post] = preg_split($this->patterns[$idx].$this->getPerlMatchingFlags(), $subject, 2); + $split = [$pre, $matches[0], $post]; - return isset($this->labels[$idx]) ? $this->labels[$idx] : true; + return $this->labels[$idx] ?? true; } /** |