Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Oct 15, 2024
1 parent d5f754d commit aa3ee10
Show file tree
Hide file tree
Showing 6 changed files with 468 additions and 23 deletions.
6 changes: 2 additions & 4 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php');

$params = $ecsConfig->parameters();

$params->set(Option::PATHS, [
$ecsConfig->paths([
'src',
'tests/Behat',
'tests/Integration',
'tests/Stub',
]);
$ecsConfig->skip(['src/Kernel.php']);

$ecsConfig->parameters()->set(Option::SKIP, [
$ecsConfig->skip([
VisibilityRequiredFixer::class => ['*Spec.php'],
]);
};
18 changes: 9 additions & 9 deletions src/Command/ServiceChangesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Command\BuildDebugContainerTrait;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -100,6 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->initializeBundles();
/**
* @var ContainerBuilder $containerBuilder
*
* @psalm-suppress UndefinedMethod
*/
$containerBuilder = $this->buildContainer();
Expand Down Expand Up @@ -175,8 +175,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'Found %s services that must be checked manually because the related alias referes to a Sylius' .
' service. Actually it\'s impossible to detect if the original class changed between versions.' .
' Here is the list ([decorated service] -> [decorating service]):',
count($syliusServicesWithAppClass)
)
count($syliusServicesWithAppClass),
),
);
foreach ($syliusServicesWithAppClass as $alias => $class) {
$this->writeLine(sprintf('"%s" -> "%s"', $alias, $class));
Expand All @@ -192,7 +192,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
private function computeServicesThatChanged(array $decoratedServicesAssociation): bool
{
$this->writeLine(
sprintf('Computing modified services between %s and %s', $this->getFromVersion(), $this->getToVersion())
sprintf('Computing modified services between %s and %s', $this->getFromVersion(), $this->getToVersion()),
);
$this->writeLine('');

Expand All @@ -215,7 +215,7 @@ private function computeServicesThatChanged(array $decoratedServicesAssociation)

$this->writeLine(sprintf(
'Found %s services that changed and were decorated ([decorated service] -> [decorating service]):',
count($decoratedServices)
count($decoratedServices),
));
foreach ($decoratedServices as $newService => $oldService) {
$this->writeLine(sprintf('"%s" -> "%s"', $oldService, $newService));
Expand Down Expand Up @@ -250,7 +250,7 @@ private function getFilesChangedBetweenTwoVersions(): array

private function compile(
ContainerBuilder $rawContainerBuilder,
DecoratorServicePass $decoratorServiceDefinitionsPass
DecoratorServicePass $decoratorServiceDefinitionsPass,
): void {
$compiler = $rawContainerBuilder->getCompiler();

Expand Down Expand Up @@ -326,7 +326,7 @@ private function isSyliusService(string $decoratedServiceId): bool
private function applyDecoratedDefinitionsStrategy(
array &$decoratedServicesAssociation,
string $alias,
?array $decoratedDef = null
?array $decoratedDef = null,
): bool {
if ($decoratedDef !== null &&
(str_starts_with($alias, sprintf('%s\\', $this->getNamespacePrefix())) ||
Expand Down Expand Up @@ -390,7 +390,7 @@ private function applyDecoratedDefinitionsNonAppClassStrategy(
/**
* @param array<string, string> $decoratedServicesAssociation
*/
private function applyAliasStrategy(array &$decoratedServicesAssociation, string $alias, string $definitionClass,): bool
private function applyAliasStrategy(array &$decoratedServicesAssociation, string $alias, string $definitionClass): bool
{
if (!class_exists($alias)) {
return false;
Expand All @@ -411,7 +411,7 @@ private function applyInnerStrategy(
array &$decoratedServicesAssociation,
Definition $definition,
array $decoratedDefintions,
string $definitionClass
string $definitionClass,
): bool {
/**
* @psalm-suppress InternalProperty
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Compiler/DecoratorServicePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Loading

0 comments on commit aa3ee10

Please sign in to comment.