Skip to content

Commit

Permalink
Apply PHPCS' PHP 7.4 rules (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Nov 11, 2023
1 parent 58d1597 commit 5de69ba
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
45 changes: 22 additions & 23 deletions Command/LoadDataFixturesDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,26 @@ protected function configure()
->addOption('purge-exclusions', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'List of database tables to ignore while purging')
->addOption('purge-with-truncate', null, InputOption::VALUE_NONE, 'Purge data by using a database-level TRUNCATE statement')
->setHelp(<<<'EOT'
The <info>%command.name%</info> command loads data fixtures from your application:
<info>php %command.full_name%</info>
Fixtures are services that are tagged with <comment>doctrine.fixture.orm</comment>.
If you want to append the fixtures instead of flushing the database first you can use the <comment>--append</comment> option:
<info>php %command.full_name%</info> <comment>--append</comment>
By default Doctrine Data Fixtures uses DELETE statements to drop the existing rows from the database.
If you want to use a TRUNCATE statement instead you can use the <comment>--purge-with-truncate</comment> flag:
<info>php %command.full_name%</info> <comment>--purge-with-truncate</comment>
To execute only fixtures that live in a certain group, use:
<info>php %command.full_name%</info> <comment>--group=group1</comment>
EOT
);
The <info>%command.name%</info> command loads data fixtures from your application:
<info>php %command.full_name%</info>
Fixtures are services that are tagged with <comment>doctrine.fixture.orm</comment>.
If you want to append the fixtures instead of flushing the database first you can use the <comment>--append</comment> option:
<info>php %command.full_name%</info> <comment>--append</comment>
By default Doctrine Data Fixtures uses DELETE statements to drop the existing rows from the database.
If you want to use a TRUNCATE statement instead you can use the <comment>--purge-with-truncate</comment> flag:
<info>php %command.full_name%</info> <comment>--purge-with-truncate</comment>
To execute only fixtures that live in a certain group, use:
<info>php %command.full_name%</info> <comment>--group=group1</comment>
EOT);
}

private function doExecute(InputInterface $input, OutputInterface $output): int
Expand Down Expand Up @@ -121,7 +120,7 @@ private function doExecute(InputInterface $input, OutputInterface $output): int
'Could not find purger factory with alias "%1$s", using default purger. Did you forget to register the %2$s implementation with tag "%3$s" and alias "%1$s"?',
$input->getOption('purger'),
PurgerFactory::class,
PurgerFactoryCompilerPass::PURGER_FACTORY_TAG
PurgerFactoryCompilerPass::PURGER_FACTORY_TAG,
));
$factory = new ORMPurgerFactory();
} else {
Expand All @@ -132,7 +131,7 @@ private function doExecute(InputInterface $input, OutputInterface $output): int
$input->getOption('em'),
$em,
$input->getOption('purge-exclusions'),
$input->getOption('purge-with-truncate')
$input->getOption('purge-with-truncate'),
);
$executor = new ORMExecutor($em, $purger);
$executor->setLogger(static function ($message) use ($ui): void {
Expand Down
2 changes: 1 addition & 1 deletion Loader/SymfonyFixturesLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function createFixture($class): FixtureInterface
throw new LogicException(sprintf(
'The "%s" fixture class is trying to be loaded, but is not available. Make sure this class is defined as a service and tagged with "%s".',
$class,
FixturesCompilerPass::FIXTURE_TAG
FixturesCompilerPass::FIXTURE_TAG,
));
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Command/LoadDataFixturesDoctrineCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testInstantiatingWithoutManagerRegistry(): void
'%s::__construct(): Argument #1 ($doctrine) must be of type %s, null given' :
'Argument 1 passed to %s::__construct() must be an instance of %s, null given',
DoctrineCommand::class,
ManagerRegistry::class
ManagerRegistry::class,
));

throw $e;
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>

<config name="php_version" value="70100"/>
<config name="php_version" value="70400"/>

<!-- Ignore warnings and show progress of the run -->
<arg value="nps"/>
Expand Down

0 comments on commit 5de69ba

Please sign in to comment.