[2.5] Remove possible call_user_func()
This commit is contained in:
parent
9500411c9a
commit
94a04cba54
@ -87,11 +87,12 @@ class BinaryNode extends Node
|
|||||||
if (isset(self::$functions[$operator])) {
|
if (isset(self::$functions[$operator])) {
|
||||||
$right = $this->nodes['right']->evaluate($functions, $values);
|
$right = $this->nodes['right']->evaluate($functions, $values);
|
||||||
|
|
||||||
if ('not in' == $operator) {
|
if ('not in' === $operator) {
|
||||||
return !call_user_func('in_array', $left, $right);
|
return !in_array($left, $right);
|
||||||
}
|
}
|
||||||
|
$f = self::$functions[$operator];
|
||||||
|
|
||||||
return call_user_func(self::$functions[$operator], $left, $right);
|
return $f($left, $right);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($operator) {
|
switch ($operator) {
|
||||||
|
@ -992,7 +992,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
$p = $this->getProcess('php -r "usleep(500000);"');
|
$p = $this->getProcess('php -r "usleep(500000);"');
|
||||||
$p->disableOutput();
|
$p->disableOutput();
|
||||||
$this->setExpectedException($exception, $exceptionMessage);
|
$this->setExpectedException($exception, $exceptionMessage);
|
||||||
call_user_func(array($p, $startMethod), function () {});
|
$p->{$startMethod}(function () {});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideStartMethods()
|
public function provideStartMethods()
|
||||||
@ -1013,7 +1013,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
$p->disableOutput();
|
$p->disableOutput();
|
||||||
$p->start();
|
$p->start();
|
||||||
$this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Output has been disabled.');
|
$this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Output has been disabled.');
|
||||||
call_user_func(array($p, $fetchMethod));
|
$p->{$fetchMethod}();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideOutputFetchingMethods()
|
public function provideOutputFetchingMethods()
|
||||||
|
@ -505,11 +505,11 @@ class PropertyAccessor implements PropertyAccessorInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($itemToRemove as $item) {
|
foreach ($itemToRemove as $item) {
|
||||||
call_user_func(array($object, $removeMethod), $item);
|
$object->{$removeMethod}($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($itemsToAdd as $item) {
|
foreach ($itemsToAdd as $item) {
|
||||||
call_user_func(array($object, $addMethod), $item);
|
$object->{$addMethod}($item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user