From ccd63cb58697cec62e15dc0deddd132b42e09a71 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 9 May 2020 13:09:43 +0700 Subject: [PATCH] change call_user_func* with self invoked function Signed-off-by: Abdul Malik Ikhsan --- test/CommonServiceLocatorBehaviorsTrait.php | 3 +-- test/TestAsset/PassthroughDelegatorFactory.php | 2 +- test/TestAsset/V2ValidationPluginManager.php | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/CommonServiceLocatorBehaviorsTrait.php b/test/CommonServiceLocatorBehaviorsTrait.php index e6d9531e..3a691bb0 100644 --- a/test/CommonServiceLocatorBehaviorsTrait.php +++ b/test/CommonServiceLocatorBehaviorsTrait.php @@ -33,7 +33,6 @@ use function array_fill_keys; use function array_keys; use function array_merge; -use function call_user_func_array; use function restore_error_handler; use function set_error_handler; @@ -812,7 +811,7 @@ public function testConfiguringInstanceRaisesExceptionIfAllowOverrideIsFalse($me $container = $this->createContainer(['services' => ['foo' => $this]]); $container->setAllowOverride(false); $this->expectException(ContainerModificationsNotAllowedException::class); - call_user_func_array([$container, $method], $args); + $container->$method(...$args); } /** diff --git a/test/TestAsset/PassthroughDelegatorFactory.php b/test/TestAsset/PassthroughDelegatorFactory.php index 2c0979a6..19201ecd 100644 --- a/test/TestAsset/PassthroughDelegatorFactory.php +++ b/test/TestAsset/PassthroughDelegatorFactory.php @@ -19,6 +19,6 @@ class PassthroughDelegatorFactory implements DelegatorFactoryInterface */ public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null) { - return call_user_func($callback); + return $callback(); } } diff --git a/test/TestAsset/V2ValidationPluginManager.php b/test/TestAsset/V2ValidationPluginManager.php index 53aa2cdf..7d3436e2 100644 --- a/test/TestAsset/V2ValidationPluginManager.php +++ b/test/TestAsset/V2ValidationPluginManager.php @@ -11,7 +11,6 @@ use Laminas\ServiceManager\AbstractPluginManager; use RuntimeException; -use function call_user_func; use function is_callable; use function sprintf; @@ -28,6 +27,6 @@ public function validatePlugin($plugin) )); } - call_user_func($this->assertion, $plugin); + ($this->assertion)($plugin); } }