From ccd2904d8c6fcee050c8681b20df71999bdbd881 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 22 Mar 2018 01:48:42 +0700 Subject: [PATCH] change call_user_func* with self invoked function --- 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 53862b6e..db2bf371 100644 --- a/test/CommonServiceLocatorBehaviorsTrait.php +++ b/test/CommonServiceLocatorBehaviorsTrait.php @@ -32,7 +32,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; @@ -811,7 +810,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 d0eec4b9..ccc5b058 100644 --- a/test/TestAsset/PassthroughDelegatorFactory.php +++ b/test/TestAsset/PassthroughDelegatorFactory.php @@ -18,6 +18,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 0633732a..35d66e97 100644 --- a/test/TestAsset/V2ValidationPluginManager.php +++ b/test/TestAsset/V2ValidationPluginManager.php @@ -10,7 +10,6 @@ use RuntimeException; use Zend\ServiceManager\AbstractPluginManager; -use function call_user_func; use function is_callable; use function sprintf; @@ -27,6 +26,6 @@ public function validatePlugin($plugin) )); } - call_user_func($this->assertion, $plugin); + ($this->assertion)($plugin); } }