diff --git a/ecs.php b/ecs.php index 9de1d8c..32320b2 100644 --- a/ecs.php +++ b/ecs.php @@ -50,6 +50,9 @@ $ecsConfig->ruleWithConfiguration(FunctionDeclarationFixer::class, [ 'closure_fn_spacing' => 'none', ]); - $ecsConfig->rule(NativeFunctionInvocationFixer::class); + $ecsConfig->ruleWithConfiguration(NativeFunctionInvocationFixer::class, [ + 'scope' => 'namespaced', + 'include' => ['@all'], + ]); $ecsConfig->rule(FinalClassFixer::class); }; diff --git a/src/DependencyInjection/YokaiSafeCommandExtension.php b/src/DependencyInjection/YokaiSafeCommandExtension.php index ad8ab28..b3dcb3b 100644 --- a/src/DependencyInjection/YokaiSafeCommandExtension.php +++ b/src/DependencyInjection/YokaiSafeCommandExtension.php @@ -22,7 +22,7 @@ public function load(array $configs, ContainerBuilder $container): void $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); $loader->load('services.xml'); - $commands = array_unique([ + $commands = \array_unique([ ...$config['standard'], ...$config['custom'], ]); diff --git a/tests/CommandDisabledTest.php b/tests/CommandDisabledTest.php index d799ba6..33dfda9 100644 --- a/tests/CommandDisabledTest.php +++ b/tests/CommandDisabledTest.php @@ -27,7 +27,7 @@ public function disabled_command_should_not_appear_in_list_command_output(): voi self::assertDoesNotMatchRegularExpression( '/' . $command . '/', $out, - sprintf('Disabled command "%s" should not appear in commands listing.', $command) + \sprintf('Disabled command "%s" should not appear in commands listing.', $command) ); } } @@ -45,13 +45,13 @@ public function disabled_command_should_not_run(string $command): void self::assertSame( ConsoleCommandEvent::RETURN_CODE_DISABLED, $exit, - sprintf('Running disabled command "%s" should return disabled return code.', $command) + \sprintf('Running disabled command "%s" should return disabled return code.', $command) ); self::assertMatchesRegularExpression( '/This command has been disabled. Aborting.../', $output->fetch(), - sprintf('Disabled command "%s" should output message to tell it wont run.', $command) + \sprintf('Disabled command "%s" should output message to tell it wont run.', $command) ); } diff --git a/tests/Stubs/YokaiSafeCommandTestKernel.php b/tests/Stubs/YokaiSafeCommandTestKernel.php index e2c0ecc..e6dbc84 100644 --- a/tests/Stubs/YokaiSafeCommandTestKernel.php +++ b/tests/Stubs/YokaiSafeCommandTestKernel.php @@ -37,11 +37,11 @@ protected function build(ContainerBuilder $container): void public function getCacheDir(): string { - return sys_get_temp_dir() . '/' . Kernel::VERSION . '/cache/' . $this->environment; + return \sys_get_temp_dir() . '/' . Kernel::VERSION . '/cache/' . $this->environment; } public function getLogDir(): string { - return sys_get_temp_dir() . '/' . Kernel::VERSION . '/logs'; + return \sys_get_temp_dir() . '/' . Kernel::VERSION . '/logs'; } }