Skip to content

Commit

Permalink
Add compatibility command registration for PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaswolf committed Oct 8, 2024
1 parent 9b649a4 commit cd1d5e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/fractor/config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use a9f\Fractor\Configuration\SkipConfigurationFactory;
use a9f\Fractor\Configuration\ValueObject\SkipConfiguration;
use a9f\Fractor\Console\Application\FractorApplication;
use a9f\Fractor\Console\Command\ProcessCommand;
use a9f\Fractor\Console\Output\OutputFormatterCollector;
use a9f\Fractor\Differ\ConsoleDiffer;
use a9f\Fractor\Differ\Contract\Differ;
Expand Down Expand Up @@ -80,6 +81,16 @@ static function (ChildDefinition $definition, AsCommand $attribute): void {
}
);

// PHP 7.4 compatibility; only required for released versions
if (PHP_MAJOR_VERSION < 8) {
$containerBuilder->register(ProcessCommand::class)
->addTag('console.command', [
'command' => 'process',
'description' => 'Runs Fractor with the given configuration file',
])
->setAutowired(true);
}

$services->set('parameter_bag', ContainerBag::class)
->args([service('service_container')])
->alias(ContainerBagInterface::class, 'parameter_bag')
Expand Down

0 comments on commit cd1d5e3

Please sign in to comment.