mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/12273] Use array_merge instead of +=
PHPBB3-12273
This commit is contained in:
parent
d2ab305909
commit
b0a9acd8ff
1 changed files with 4 additions and 4 deletions
|
@ -302,17 +302,17 @@ class php_exporter
|
||||||
{
|
{
|
||||||
$line = ltrim($this->file_lines[$this->current_event_line - $vars_array_line], "\t");
|
$line = ltrim($this->file_lines[$this->current_event_line - $vars_array_line], "\t");
|
||||||
$match = array();
|
$match = array();
|
||||||
preg_match('#^\$vars (?:\+)?= array\(\'([a-zA-Z0-9_\' ,]+)\'\);$#', $line, $match);
|
preg_match('#^\$vars = (array_merge\(\$vars, )?array\(\'([a-zA-Z0-9_\' ,]+)\'\)(?(1)\));$#', $line, $match);
|
||||||
|
|
||||||
if (isset($match[1]))
|
if (isset($match[2]))
|
||||||
{
|
{
|
||||||
$found_vars_array = true;
|
$found_vars_array = true;
|
||||||
if (strlen($match[1]) > 90)
|
if (strlen($match[2]) > 90)
|
||||||
{
|
{
|
||||||
throw new \LogicException('Should use multiple lines for $vars definition '
|
throw new \LogicException('Should use multiple lines for $vars definition '
|
||||||
. "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
|
. "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
|
||||||
}
|
}
|
||||||
$vars_array = array_merge($vars_array, explode("', '", $match[1]));
|
$vars_array = array_merge($vars_array, explode("', '", $match[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars_array_line++;
|
$vars_array_line++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue