Skip to content

Commit

Permalink
change call_user_func* with self invoked function
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
  • Loading branch information
samsonasik committed May 9, 2020
1 parent 7e94866 commit ccd63cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions test/CommonServiceLocatorBehaviorsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/TestAsset/PassthroughDelegatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
3 changes: 1 addition & 2 deletions test/TestAsset/V2ValidationPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Laminas\ServiceManager\AbstractPluginManager;
use RuntimeException;

use function call_user_func;
use function is_callable;
use function sprintf;

Expand All @@ -28,6 +27,6 @@ public function validatePlugin($plugin)
));
}

call_user_func($this->assertion, $plugin);
($this->assertion)($plugin);
}
}

0 comments on commit ccd63cb

Please sign in to comment.