aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Parsing/Lexer/ParallelRegex.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/Parsing/Lexer/ParallelRegex.php')
-rw-r--r--inc/Parsing/Lexer/ParallelRegex.php15
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;
}
/**