Skip to content

Commit

Permalink
Merge pull request #3 from yokai-php/fix-style
Browse files Browse the repository at this point in the history
Fixed native function invocation style setting
  • Loading branch information
yann-eugone authored Jan 8, 2024
2 parents 4aa5fa2 + 0acb066 commit f125009
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
2 changes: 1 addition & 1 deletion src/DependencyInjection/YokaiSafeCommandExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
]);
Expand Down
6 changes: 3 additions & 3 deletions tests/CommandDisabledTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
}
Expand All @@ -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)
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/YokaiSafeCommandTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}

0 comments on commit f125009

Please sign in to comment.