diff --git a/Command/CreateDatabaseDoctrineCommand.php b/Command/CreateDatabaseDoctrineCommand.php index 9b806435b..0c7895f39 100644 --- a/Command/CreateDatabaseDoctrineCommand.php +++ b/Command/CreateDatabaseDoctrineCommand.php @@ -27,7 +27,7 @@ protected function configure(): void ->setDescription('Creates the configured database') ->addOption('connection', 'c', InputOption::VALUE_OPTIONAL, 'The connection to use for this command') ->addOption('if-not-exists', null, InputOption::VALUE_NONE, 'Don\'t trigger an error, when the database already exists') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command creates the default connections database: php %command.full_name% @@ -35,8 +35,7 @@ protected function configure(): void You can also optionally specify the name of a connection to create the database for: php %command.full_name% --connection=default -EOT - ); +EOT); } protected function execute(InputInterface $input, OutputInterface $output): int diff --git a/Command/DropDatabaseDoctrineCommand.php b/Command/DropDatabaseDoctrineCommand.php index 93945bdc2..8ffd23375 100644 --- a/Command/DropDatabaseDoctrineCommand.php +++ b/Command/DropDatabaseDoctrineCommand.php @@ -36,7 +36,7 @@ protected function configure() ->addOption('connection', 'c', InputOption::VALUE_OPTIONAL, 'The connection to use for this command') ->addOption('if-exists', null, InputOption::VALUE_NONE, 'Don\'t trigger an error, when the database doesn\'t exist') ->addOption('force', 'f', InputOption::VALUE_NONE, 'Set this parameter to execute this action') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command drops the default connections database: php %command.full_name% @@ -48,8 +48,7 @@ protected function configure() php %command.full_name% --connection=default Be careful: All data in a given database will be lost when executing this command. -EOT - ); +EOT); } protected function execute(InputInterface $input, OutputInterface $output): int diff --git a/Command/ImportMappingDoctrineCommand.php b/Command/ImportMappingDoctrineCommand.php index b71efd545..951eea691 100644 --- a/Command/ImportMappingDoctrineCommand.php +++ b/Command/ImportMappingDoctrineCommand.php @@ -52,15 +52,15 @@ protected function configure(): void ->addOption('force', null, InputOption::VALUE_NONE, 'Force to overwrite existing mapping files.') ->addOption('path', null, InputOption::VALUE_REQUIRED, 'The path where the files would be generated (not used when a bundle is passed).') ->setDescription('Imports mapping information from an existing database') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command imports mapping information from an existing database: Generate annotation mappings into the src/ directory using App as the namespace: -php %command.full_name% App\\\Entity annotation --path=src/Entity +php %command.full_name% App\\Entity annotation --path=src/Entity Generate xml mappings into the config/doctrine/ directory using App as the namespace: -php %command.full_name% App\\\Entity xml --path=config/doctrine +php %command.full_name% App\\Entity xml --path=config/doctrine Generate XML mappings into a bundle: php %command.full_name% "MyCustomBundle" xml @@ -79,8 +79,7 @@ protected function configure(): void Use the --force option, if you want to override existing mapping files: php %command.full_name% "MyCustomBundle" xml --force -EOT - ); +EOT); } protected function execute(InputInterface $input, OutputInterface $output): int diff --git a/Command/Proxy/ConvertMappingDoctrineCommand.php b/Command/Proxy/ConvertMappingDoctrineCommand.php index 7e5c69d84..67430e2ab 100644 --- a/Command/Proxy/ConvertMappingDoctrineCommand.php +++ b/Command/Proxy/ConvertMappingDoctrineCommand.php @@ -24,6 +24,7 @@ class ConvertMappingDoctrineCommand extends ConvertMappingCommand protected function configure() { parent::configure(); + $this ->setName('doctrine:mapping:convert'); diff --git a/Command/Proxy/DoctrineCommandHelper.php b/Command/Proxy/DoctrineCommandHelper.php index 8965e7d3e..277fc0f18 100644 --- a/Command/Proxy/DoctrineCommandHelper.php +++ b/Command/Proxy/DoctrineCommandHelper.php @@ -35,7 +35,7 @@ public static function setApplicationEntityManager(Application $application, $em '2.7', 'Providing an EntityManager using "%s" is deprecated. Use an instance of "%s" instead.', EntityManagerHelper::class, - EntityManagerProvider::class + EntityManagerProvider::class, ); } } diff --git a/Command/Proxy/OrmProxyCommand.php b/Command/Proxy/OrmProxyCommand.php index 3628c6449..1f3cdb26f 100644 --- a/Command/Proxy/OrmProxyCommand.php +++ b/Command/Proxy/OrmProxyCommand.php @@ -19,6 +19,7 @@ trait OrmProxyCommand public function __construct(?EntityManagerProvider $entityManagerProvider = null) { parent::__construct($entityManagerProvider); + $this->entityManagerProvider = $entityManagerProvider; trigger_deprecation( @@ -26,7 +27,7 @@ public function __construct(?EntityManagerProvider $entityManagerProvider = null '2.8', 'Class "%s" is deprecated. Use "%s" instead.', self::class, - parent::class + parent::class, ); } diff --git a/Command/Proxy/RunDqlDoctrineCommand.php b/Command/Proxy/RunDqlDoctrineCommand.php index 59c32b364..8051912f7 100644 --- a/Command/Proxy/RunDqlDoctrineCommand.php +++ b/Command/Proxy/RunDqlDoctrineCommand.php @@ -20,7 +20,7 @@ protected function configure(): void $this ->setName('doctrine:query:dql') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command executes the given DQL query and outputs the results: @@ -35,8 +35,7 @@ protected function configure(): void show: php %command.full_name% "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30 -EOT - ); +EOT); if ($this->getDefinition()->hasOption('em')) { return; diff --git a/Command/Proxy/RunSqlDoctrineCommand.php b/Command/Proxy/RunSqlDoctrineCommand.php index 9c9b9372f..7977a4cbd 100644 --- a/Command/Proxy/RunSqlDoctrineCommand.php +++ b/Command/Proxy/RunSqlDoctrineCommand.php @@ -21,13 +21,12 @@ protected function configure(): void $this ->setName('doctrine:query:sql') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command executes the given SQL query and outputs the results: php %command.full_name% "SELECT * FROM users" -EOT - ); +EOT); } protected function execute(InputInterface $input, OutputInterface $output): int @@ -36,7 +35,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'doctrine/doctrine-bundle', '2.2', 'The "%s" (doctrine:query:sql) is deprecated, use dbal:run-sql command instead.', - self::class + self::class, ); return parent::execute($input, $output); diff --git a/ConnectionFactory.php b/ConnectionFactory.php index 158fecc6a..cd0ed2604 100644 --- a/ConnectionFactory.php +++ b/ConnectionFactory.php @@ -117,7 +117,7 @@ public function createConnection(array $params, ?Configuration $config = null, ? $params = $this->addDatabaseSuffix(array_merge($connection->getParams(), $overriddenOptions)); $driver = $connection->getDriver(); $platform = $driver->getDatabasePlatform( - ...(class_exists(StaticServerVersionProvider::class) ? [new StaticServerVersionProvider($params['serverVersion'] ?? '')] : []) + ...(class_exists(StaticServerVersionProvider::class) ? [new StaticServerVersionProvider($params['serverVersion'] ?? '')] : []), ); if (! isset($params['charset'])) { @@ -128,7 +128,7 @@ public function createConnection(array $params, ?Configuration $config = null, ? Deprecation::trigger( 'doctrine/doctrine-bundle', 'https://github.com/doctrine/dbal/issues/5214', - 'The "collate" default table option is deprecated in favor of "collation" and will be removed in doctrine/doctrine-bundle 3.0. ' + 'The "collate" default table option is deprecated in favor of "collation" and will be removed in doctrine/doctrine-bundle 3.0. ', ); $params['defaultTableOptions']['collation'] = $params['defaultTableOptions']['collate']; unset($params['defaultTableOptions']['collate']); @@ -186,7 +186,7 @@ private function getDatabasePlatform(Connection $connection): AbstractPlatform 'For further information have a look at:' . PHP_EOL . 'https://github.com/doctrine/DoctrineBundle/issues/673', 0, - $driverException + $driverException, ); } } diff --git a/DependencyInjection/Compiler/CacheCompatibilityPass.php b/DependencyInjection/Compiler/CacheCompatibilityPass.php index 28c1ccecb..cefe51bb3 100644 --- a/DependencyInjection/Compiler/CacheCompatibilityPass.php +++ b/DependencyInjection/Compiler/CacheCompatibilityPass.php @@ -103,7 +103,7 @@ private function createCompatibilityLayerDefinition(ContainerBuilder $container, 'doctrine/doctrine-bundle', '2.4', 'Configuring doctrine/cache is deprecated. Please update the cache service "%s" to use a PSR-6 cache.', - $definitionId + $definitionId, ); return (new Definition(CacheItemPoolInterface::class)) diff --git a/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php b/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php index c47958fda..e2d11bea8 100644 --- a/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php +++ b/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php @@ -41,6 +41,7 @@ class DoctrineOrmMappingsPass extends RegisterMappingsPass public function __construct($driver, array $namespaces, array $managerParameters, $enabledParameter = false, array $aliasMap = []) { $managerParameters[] = 'doctrine.default_entity_manager'; + parent::__construct( $driver, $namespaces, @@ -49,7 +50,7 @@ public function __construct($driver, array $namespaces, array $managerParameters $enabledParameter, 'doctrine.orm.%s_configuration', 'addEntityNamespace', - $aliasMap + $aliasMap, ); } diff --git a/DependencyInjection/Compiler/EntityListenerPass.php b/DependencyInjection/Compiler/EntityListenerPass.php index d58399a8b..d2e13a526 100644 --- a/DependencyInjection/Compiler/EntityListenerPass.php +++ b/DependencyInjection/Compiler/EntityListenerPass.php @@ -64,7 +64,7 @@ public function process(ContainerBuilder $container) if ($lazyByAttribute && ! $resolverSupportsLazyListeners) { throw new InvalidArgumentException(sprintf( 'Lazy-loaded entity listeners can only be resolved by a resolver implementing %s.', - EntityListenerServiceResolver::class + EntityListenerServiceResolver::class, )); } diff --git a/DependencyInjection/Compiler/MiddlewaresPass.php b/DependencyInjection/Compiler/MiddlewaresPass.php index 3283f9431..be3619916 100644 --- a/DependencyInjection/Compiler/MiddlewaresPass.php +++ b/DependencyInjection/Compiler/MiddlewaresPass.php @@ -54,7 +54,7 @@ public function process(ContainerBuilder $container): void $middlewareDefs[$id] = [ $childDef = $container->setDefinition( sprintf('%s.%s', $id, $name), - new ChildDefinition($id) + new ChildDefinition($id), ), ++$i, ]; diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index cbf942383..aba623dc8 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -202,7 +202,7 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition ->setDeprecated( 'doctrine/doctrine-bundle', '2.9', - 'The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.' + 'The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.', ) ->end() ->booleanNode('auto_commit')->end() @@ -240,7 +240,7 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition ->arrayNode('default_table_options') ->info(sprintf( "This option is used by the schema-tool and affects generated SQL. Possible keys include 'charset','%s', and 'engine'.", - $collationKey + $collationKey, )) ->useAttributeAsKey('name') ->prototype('scalar')->end() @@ -299,7 +299,7 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node): void '2.4', 'Setting the "doctrine.dbal.%s" %s while the "url" one is defined is deprecated', implode('", "', $urlConflictingValues), - $tail + $tail, ); } @@ -332,7 +332,7 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node): void ->scalarNode('servicename') ->info( 'Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter ' . - 'for Oracle depending on the service parameter.' + 'for Oracle depending on the service parameter.', ) ->end() ->scalarNode('sessionMode') @@ -343,34 +343,34 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node): void ->end() ->scalarNode('default_dbname') ->info( - 'Override the default database (postgres) to connect to for PostgreSQL connexion.' + 'Override the default database (postgres) to connect to for PostgreSQL connexion.', ) ->end() ->scalarNode('sslmode') ->info( 'Determines whether or with what priority a SSL TCP/IP connection will be negotiated with ' . - 'the server for PostgreSQL.' + 'the server for PostgreSQL.', ) ->end() ->scalarNode('sslrootcert') ->info( 'The name of a file containing SSL certificate authority (CA) certificate(s). ' . - 'If the file exists, the server\'s certificate will be verified to be signed by one of these authorities.' + 'If the file exists, the server\'s certificate will be verified to be signed by one of these authorities.', ) ->end() ->scalarNode('sslcert') ->info( - 'The path to the SSL client certificate file for PostgreSQL.' + 'The path to the SSL client certificate file for PostgreSQL.', ) ->end() ->scalarNode('sslkey') ->info( - 'The path to the SSL client key file for PostgreSQL.' + 'The path to the SSL client key file for PostgreSQL.', ) ->end() ->scalarNode('sslcrl') ->info( - 'The file name of the SSL certificate revocation list for PostgreSQL.' + 'The file name of the SSL certificate revocation list for PostgreSQL.', ) ->end() ->booleanNode('pooled')->info('True to use a pooled server with the oci8/pdo_oracle driver')->end() @@ -380,7 +380,7 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node): void ->info( 'Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection.' . ' It is generally used to connect to an Oracle RAC server to select the name' . - ' of a particular instance.' + ' of a particular instance.', ) ->end() ->scalarNode('connectstring') @@ -388,7 +388,7 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node): void 'Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.' . 'When using this option, you will still need to provide the user and password parameters, but the other ' . 'parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods' . - ' from Doctrine\DBAL\Connection will no longer function as expected.' + ' from Doctrine\DBAL\Connection will no longer function as expected.', ) ->end() ->end() diff --git a/DependencyInjection/DoctrineExtension.php b/DependencyInjection/DoctrineExtension.php index 0fe693f27..5633d4516 100644 --- a/DependencyInjection/DoctrineExtension.php +++ b/DependencyInjection/DoctrineExtension.php @@ -241,7 +241,7 @@ protected function loadDbalConnection($name, array $connection, ContainerBuilder unset( $connection['profiling'], $connection['profiling_collect_backtrace'], - $connection['profiling_collect_schema_errors'] + $connection['profiling_collect_schema_errors'], ); if (isset($connection['auto_commit'])) { @@ -298,7 +298,7 @@ protected function loadDbalConnection($name, array $connection, ContainerBuilder $container->setDefinition( ManagerRegistryAwareConnectionProvider::class, - new Definition(ManagerRegistryAwareConnectionProvider::class, [$container->getDefinition('doctrine')]) + new Definition(ManagerRegistryAwareConnectionProvider::class, [$container->getDefinition('doctrine')]), ); $configuration->addMethodCall('setSchemaManagerFactory', [new Reference($connection['schema_manager_factory'])]); @@ -548,7 +548,7 @@ protected function ormLoad(array $config, ContainerBuilder $container) if (! method_exists(OrmConfiguration::class, 'setLazyGhostObjectEnabled')) { throw new LogicException( 'Lazy ghost objects cannot be enabled because the "doctrine/orm" library' - . ' version 2.14 or higher is not installed. Please run "composer update doctrine/orm".' + . ' version 2.14 or higher is not installed. Please run "composer update doctrine/orm".', ); } @@ -557,14 +557,14 @@ protected function ormLoad(array $config, ContainerBuilder $container) if (! trait_exists(LazyGhostTrait::class)) { throw new LogicException( 'Lazy ghost objects cannot be enabled because the "symfony/var-exporter" library' - . ' version 6.2 or higher is not installed. Please run "composer require symfony/var-exporter:^6.2".' + . ' version 6.2 or higher is not installed. Please run "composer require symfony/var-exporter:^6.2".', ); } if (! class_exists(RuntimeReflectionProperty::class)) { throw new LogicException( 'Lazy ghost objects cannot be enabled because the "doctrine/persistence" library' - . ' version 3.1 or higher is not installed. Please run "composer update doctrine/persistence".' + . ' version 3.1 or higher is not installed. Please run "composer update doctrine/persistence".', ); } } @@ -768,7 +768,7 @@ protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $ $container->setAlias( sprintf('doctrine.orm.%s_entity_manager.event_manager', $entityManager['name']), - new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $entityManager['connection']), false) + new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $entityManager['connection']), false), ); if (! isset($entityManager['entity_listeners'])) { @@ -1028,7 +1028,7 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD 'Unknown cache of type "%s" configured for cache "%s" in entity manager "%s".', $cacheDriver['type'], $cacheName, - $objectManagerName + $objectManagerName, )); } diff --git a/Mapping/ContainerEntityListenerResolver.php b/Mapping/ContainerEntityListenerResolver.php index d66dcc831..b2ff245c8 100644 --- a/Mapping/ContainerEntityListenerResolver.php +++ b/Mapping/ContainerEntityListenerResolver.php @@ -30,7 +30,7 @@ public function __construct(ContainerInterface $container) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function clear($className = null) { @@ -46,7 +46,7 @@ public function clear($className = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function register($object) { @@ -60,7 +60,7 @@ public function register($object) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function registerService($className, $serviceId) { @@ -68,7 +68,7 @@ public function registerService($className, $serviceId) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function resolve($className) { diff --git a/Orm/ManagerRegistryAwareEntityManagerProvider.php b/Orm/ManagerRegistryAwareEntityManagerProvider.php index 777d4c645..4ef72eb83 100644 --- a/Orm/ManagerRegistryAwareEntityManagerProvider.php +++ b/Orm/ManagerRegistryAwareEntityManagerProvider.php @@ -36,8 +36,8 @@ public function getManager(string $name): EntityManagerInterface sprintf( 'Only managers of type "%s" are supported. Instance of "%s given.', EntityManagerInterface::class, - get_class($em) - ) + get_class($em), + ), ); } } diff --git a/Repository/ContainerRepositoryFactory.php b/Repository/ContainerRepositoryFactory.php index 654833a6d..030d224c4 100644 --- a/Repository/ContainerRepositoryFactory.php +++ b/Repository/ContainerRepositoryFactory.php @@ -32,7 +32,7 @@ public function __construct(ContainerInterface $container) } /** - * {@inheritdoc} + * {@inheritDoc} * * @template T of object */ diff --git a/Repository/LazyServiceEntityRepository.php b/Repository/LazyServiceEntityRepository.php index 821e736b0..e17a0e3f8 100644 --- a/Repository/LazyServiceEntityRepository.php +++ b/Repository/LazyServiceEntityRepository.php @@ -47,7 +47,7 @@ public function __construct(ManagerRegistry $registry, string $entityClass) if ($manager === null) { throw new LogicException(sprintf( 'Could not find the entity manager for class "%s". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.', - $entityClass + $entityClass, )); } diff --git a/Repository/ServiceEntityRepository.php b/Repository/ServiceEntityRepository.php index e5e00ce43..0b580fb56 100644 --- a/Repository/ServiceEntityRepository.php +++ b/Repository/ServiceEntityRepository.php @@ -49,7 +49,7 @@ public function __construct(ManagerRegistry $registry, string $entityClass) if ($manager === null) { throw new LogicException(sprintf( 'Could not find the entity manager for class "%s". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.', - $entityClass + $entityClass, )); } diff --git a/Tests/Command/CreateDatabaseDoctrineTest.php b/Tests/Command/CreateDatabaseDoctrineTest.php index 81af34f02..4fc8b735a 100644 --- a/Tests/Command/CreateDatabaseDoctrineTest.php +++ b/Tests/Command/CreateDatabaseDoctrineTest.php @@ -44,12 +44,12 @@ public function testExecute(): void $commandTester = new CommandTester($command); $commandTester->execute( - array_merge(['command' => $command->getName()]) + array_merge(['command' => $command->getName()]), ); $this->assertStringContainsString( 'Created database ' . sys_get_temp_dir() . '/' . $dbName . ' for connection named ' . $connectionName, - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } diff --git a/Tests/Command/DropDatabaseDoctrineTest.php b/Tests/Command/DropDatabaseDoctrineTest.php index 6a39e08b9..adc5fc82c 100644 --- a/Tests/Command/DropDatabaseDoctrineTest.php +++ b/Tests/Command/DropDatabaseDoctrineTest.php @@ -47,16 +47,16 @@ public function testExecute(array $options): void $commandTester = new CommandTester($command); $commandTester->execute( - array_merge(['command' => $command->getName()], $options) + array_merge(['command' => $command->getName()], $options), ); $this->assertStringContainsString( sprintf( 'Dropped database %s for connection named %s', sys_get_temp_dir() . '/' . $dbName, - $connectionName + $connectionName, ), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -90,20 +90,20 @@ public function testExecuteWithoutOptionForceWillFailWithAttentionMessage(): voi $commandTester = new CommandTester($command); $commandTester->execute( - array_merge(['command' => $command->getName()]) + array_merge(['command' => $command->getName()]), ); $this->assertStringContainsString( sprintf( 'Would drop the database %s for connection named %s.', sys_get_temp_dir() . '/' . $dbName, - $connectionName + $connectionName, ), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); $this->assertStringContainsString( 'Please run the operation with --force to execute', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } diff --git a/Tests/Command/ImportMappingDoctrineCommandTest.php b/Tests/Command/ImportMappingDoctrineCommandTest.php index 6c8c319fe..9520c12b0 100644 --- a/Tests/Command/ImportMappingDoctrineCommandTest.php +++ b/Tests/Command/ImportMappingDoctrineCommandTest.php @@ -82,7 +82,7 @@ public function testExecuteXmlWithBundle(): void $this->assertStringContainsString( '"Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity\Product"', file_get_contents($expectedMetadataPath), - 'Metadata contains correct namespace' + 'Metadata contains correct namespace', ); } @@ -98,7 +98,7 @@ public function testExecuteAnnotationsWithBundle(): void $this->assertStringContainsString( 'namespace Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity;', file_get_contents($expectedMetadataPath), - 'File contains correct namespace' + 'File contains correct namespace', ); } @@ -121,7 +121,7 @@ public function testExecuteXmlWithNamespace(): void $this->assertStringContainsString( '"Some\Namespace\Entity\Product"', file_get_contents($expectedMetadataPath), - 'Metadata contains correct namespace' + 'Metadata contains correct namespace', ); } @@ -138,7 +138,7 @@ public function testExecuteAnnotationsWithNamespace(): void $this->assertStringContainsString( 'namespace Some\Namespace\Entity;', file_get_contents($expectedMetadataPath), - 'Metadata contains correct namespace' + 'Metadata contains correct namespace', ); } } diff --git a/Tests/Command/Proxy/InfoDoctrineCommandTest.php b/Tests/Command/Proxy/InfoDoctrineCommandTest.php index 8b73d7fdf..26fb390a6 100644 --- a/Tests/Command/Proxy/InfoDoctrineCommandTest.php +++ b/Tests/Command/Proxy/InfoDoctrineCommandTest.php @@ -42,7 +42,7 @@ public function testExecute(): void $this->assertStringContainsString( 'Found 3 mapped entities', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/Tests/ConnectionFactoryTest.php b/Tests/ConnectionFactoryTest.php index 1a75977cf..60726c48a 100644 --- a/Tests/ConnectionFactoryTest.php +++ b/Tests/ConnectionFactoryTest.php @@ -21,6 +21,7 @@ class ConnectionFactoryTest extends TestCase protected function setUp(): void { parent::setUp(); + $this->configuration = (new Configuration())->setSchemaManagerFactory(new DefaultSchemaManagerFactory()); } @@ -57,7 +58,7 @@ public function testDefaultCollationMySql(): void $this->assertSame( 'utf8mb4_unicode_ci', - $connection->getParams()['defaultTableOptions']['collation'] + $connection->getParams()['defaultTableOptions']['collation'], ); } @@ -66,21 +67,21 @@ public function testCollateMapsToCollationForMySql(): void { $factory = new ConnectionFactory([]); $this->expectDeprecationWithIdentifier( - 'https://github.com/doctrine/dbal/issues/5214' + 'https://github.com/doctrine/dbal/issues/5214', ); $connection = $factory->createConnection( [ 'driver' => 'pdo_mysql', 'defaultTableOptions' => ['collate' => 'my_collation'], ], - $this->configuration + $this->configuration, ); $tableOptions = $connection->getParams()['defaultTableOptions']; $this->assertArrayNotHasKey('collate', $tableOptions); $this->assertSame( 'my_collation', - $tableOptions['collation'] + $tableOptions['collation'], ); } @@ -100,7 +101,7 @@ public function testConnectionOverrideOptions(): void 'url' => 'mysql://root:password@database:3306/main?serverVersion=mariadb-10.5.8', 'connection_override_options' => $params, ], - $this->configuration + $this->configuration, ); $this->assertEquals($params, array_intersect_key($connection->getParams(), $params)); @@ -110,7 +111,7 @@ public function testConnectionCharsetFromUrl() { $connection = (new ConnectionFactory([]))->createConnection( ['url' => 'mysql://root:password@database:3306/main?charset=utf8mb4_unicode_ci'], - $this->configuration + $this->configuration, ); $this->assertEquals('utf8mb4_unicode_ci', $connection->getParams()['charset']); @@ -123,7 +124,7 @@ public function testDbnameSuffix(): void 'url' => 'mysql://root:password@database:3306/main?serverVersion=mariadb-10.5.8', 'dbname_suffix' => '_test', ], - $this->configuration + $this->configuration, ); $this->assertSame('main_test', $connection->getParams()['dbname']); @@ -145,7 +146,7 @@ public function testDbnameSuffixForReplicas(): void ], ], ], - $this->configuration + $this->configuration, ); $parsedParams = $connection->getParams(); @@ -163,7 +164,7 @@ class FakeConnection extends Connection public static int $creationCount = 0; /** - * {@inheritdoc} + * {@inheritDoc} */ public function __construct(array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null) { diff --git a/Tests/Dbal/SchemaAssetsFilterManagerTest.php b/Tests/Dbal/SchemaAssetsFilterManagerTest.php index 8fc2ad18a..0b161a39a 100644 --- a/Tests/Dbal/SchemaAssetsFilterManagerTest.php +++ b/Tests/Dbal/SchemaAssetsFilterManagerTest.php @@ -20,7 +20,7 @@ public function testInvoke(): void $tables = ['do_not_filter', 't_filter_me', 's_filter_me_too']; $this->assertSame( ['do_not_filter'], - array_values(array_filter($tables, $manager)) + array_values(array_filter($tables, $manager)), ); } } diff --git a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index f96a9e344..4e9be9221 100644 --- a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -216,7 +216,7 @@ public function testDbalLoadSinglePrimaryReplicaConnection(): void 'unix_socket' => '/path/to/mysqld.sock', 'driverOptions' => [PDO::ATTR_STRINGIFY_FETCHES => 1], ], - $param['primary'] + $param['primary'], ); $this->assertEquals( [ @@ -228,7 +228,7 @@ public function testDbalLoadSinglePrimaryReplicaConnection(): void 'unix_socket' => '/path/to/mysqld_replica.sock', 'driverOptions' => [PDO::ATTR_STRINGIFY_FETCHES => 1], ], - $param['replica']['replica1'] + $param['replica']['replica1'], ); $this->assertEquals(['engine' => 'InnoDB'], $param['defaultTableOptions']); } @@ -281,13 +281,13 @@ public function testDbalSchemaManagerFactory(): void new Reference(class_exists(LegacySchemaManagerFactory::class) ? 'doctrine.dbal.legacy_schema_manager_factory' : 'doctrine.dbal.default_schema_manager_factory'), - ] + ], ); $this->assertDICDefinitionMethodCallOnce( $container->getDefinition('doctrine.dbal.custom_schema_manager_factory_connection.configuration'), 'setSchemaManagerFactory', - [new Reference('custom_factory')] + [new Reference('custom_factory')], ); } @@ -538,7 +538,7 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void ] : [], [ __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'Bundles' . DIRECTORY_SEPARATOR . 'AttributesBundle' . DIRECTORY_SEPARATOR . 'Entity', - ] + ], ), false, ]); @@ -645,7 +645,7 @@ public function testSetTypes(): void $this->assertEquals( ['test' => ['class' => TestType::class]], - $container->getParameter('doctrine.dbal.connection_factory.types') + $container->getParameter('doctrine.dbal.connection_factory.types'), ); $this->assertEquals('%doctrine.dbal.connection_factory.types%', $container->getDefinition('doctrine.dbal.connection_factory')->getArgument(0)); } @@ -870,7 +870,7 @@ public function testSecondLevelCache(): void $this->assertEquals('doctrine.orm.default_second_level_cache.region.my_query_region', $myQueryRegionArgs[0]); $this->assertStringContainsString( '/doctrine/orm/slc/filelock', - $myQueryRegionArgs[1] + $myQueryRegionArgs[1], ); $this->assertEquals(60, $myQueryRegionArgs[2]); diff --git a/Tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php b/Tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php index 0502c3237..1f731bafa 100644 --- a/Tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php +++ b/Tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php @@ -76,12 +76,12 @@ public function registerContainerConfiguration(LoaderInterface $loader): void ], ], ], - ] + ], ); $containerBuilder->register($this->regionClass, $this->regionClass); $containerBuilder->setDefinition( 'custom_cache_service', - new Definition(ArrayAdapter::class) + new Definition(ArrayAdapter::class), ); }); } @@ -99,11 +99,11 @@ public function registerContainerConfiguration(LoaderInterface $loader): void $loader->load(static function (ContainerBuilder $containerBuilder): void { $containerBuilder->loadFromExtension( 'doctrine', - ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'custom_cache_service']]] + ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'custom_cache_service']]], ); $containerBuilder->setDefinition( 'custom_cache_service', - new Definition(ArrayAdapter::class) + new Definition(ArrayAdapter::class), ); }); } @@ -121,13 +121,13 @@ public function registerContainerConfiguration(LoaderInterface $loader): void $loader->load(static function (ContainerBuilder $containerBuilder): void { $containerBuilder->loadFromExtension( 'doctrine', - ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'custom_cache_service']]] + ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'custom_cache_service']]], ); $containerBuilder->setDefinition( 'custom_cache_service', (new Definition(DoctrineProvider::class)) ->setArguments([new Definition(ArrayAdapter::class)]) - ->setFactory([DoctrineProvider::class, 'wrap']) + ->setFactory([DoctrineProvider::class, 'wrap']), ); }); } diff --git a/Tests/DependencyInjection/Compiler/MiddlewarePassTest.php b/Tests/DependencyInjection/Compiler/MiddlewarePassTest.php index a72dd899c..ca6151548 100644 --- a/Tests/DependencyInjection/Compiler/MiddlewarePassTest.php +++ b/Tests/DependencyInjection/Compiler/MiddlewarePassTest.php @@ -379,7 +379,7 @@ private function assertMiddlewareInjected( $this->assertCount(1, $middlewareFound, sprintf( 'Middleware %s not injected in doctrine.dbal.%s_connection.configuration', $middlewareClass, - $connName + $connName, )); $callsFound = []; @@ -409,7 +409,7 @@ private function assertMiddlewareNotInjected( $this->assertCount(0, $middlewareFound, sprintf( 'Middleware %s injected in doctrine.dbal.%s_connection.configuration', $middlewareClass, - $connName + $connName, )); } @@ -428,7 +428,7 @@ private function assertMiddlewareOrdering( $this->assertSame($expectedOrder, $classes, sprintf( 'Middlewares ordered as %s in doctrine.dbal.%s_connection.configuration', implode(', ', $classes), - $connName + $connName, )); } diff --git a/Tests/DependencyInjection/DoctrineExtensionTest.php b/Tests/DependencyInjection/DoctrineExtensionTest.php index caa861de7..6120ab46e 100644 --- a/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -253,7 +253,7 @@ public function testOrmRequiresDbal(): void $this->expectException(LogicException::class); $this->expectExceptionMessage( - 'Configuring the ORM layer requires to configure the DBAL layer as well.' + 'Configuring the ORM layer requires to configure the DBAL layer as well.', ); $extension->load([['orm' => ['auto_mapping' => true]]], $this->getContainer()); } @@ -335,7 +335,7 @@ public function testAutomapping(array $entityManagers): void 'orm' => ['entity_managers' => $entityManagers], ], ], - $container + $container, ); $configEm1 = $container->getDefinition('doctrine.orm.em1_configuration'); @@ -349,7 +349,7 @@ public function testAutomapping(array $entityManagers): void ['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity'], ], ], - $configEm1->getMethodCalls() + $configEm1->getMethodCalls(), ); $this->assertContains( @@ -359,7 +359,7 @@ public function testAutomapping(array $entityManagers): void ['XmlBundle' => 'Fixtures\Bundles\XmlBundle\Entity'], ], ], - $configEm2->getMethodCalls() + $configEm2->getMethodCalls(), ); $this->assertContains( @@ -369,7 +369,7 @@ public function testAutomapping(array $entityManagers): void ['NewXmlBundle' => 'Fixtures\Bundles\NewXmlBundle\Entity'], ], ], - $configEm3->getMethodCalls() + $configEm3->getMethodCalls(), ); } @@ -410,7 +410,7 @@ public function testDbalWrapperClass(): void ['dbal' => ['default_connection' => 'foo']], [], ], - $container + $container, ); $this->assertEquals(TestWrapperClass::class, $container->getDefinition('doctrine.dbal.default_connection')->getClass()); @@ -522,7 +522,7 @@ public function testDependencyInjectionConfigurationDefaults(): void new Reference('doctrine.orm.default_entity_manager'), '%kernel.cache_dir%/doctrine/orm/default_metadata.php', ], - $definition->getArguments() + $definition->getArguments(), ); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_metadata_cache')); @@ -720,7 +720,7 @@ public function testBundleEntityAliases(): void $this->assertDICDefinitionMethodCallOnce( $definition, 'setEntityNamespaces', - [['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity']] + [['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity']], ); } @@ -743,7 +743,7 @@ public function testOverwriteEntityAliases(): void $this->assertDICDefinitionMethodCallOnce( $definition, 'setEntityNamespaces', - [['yml' => 'Fixtures\Bundles\YamlBundle\Entity']] + [['yml' => 'Fixtures\Bundles\YamlBundle\Entity']], ); } @@ -982,7 +982,7 @@ public function testAnnotationsBundleMappingDetectionWithVendorNamespace(): void $calls = $container->getDefinition('doctrine.orm.default_metadata_driver')->getMethodCalls(); $this->assertEquals( sprintf('doctrine.orm.default_%s_metadata_driver', PHP_VERSION_ID >= 80000 ? 'attribute' : 'annotation'), - (string) $calls[0][1][0] + (string) $calls[0][1][0], ); $this->assertEquals('Fixtures\Bundles\Vendor\AnnotationsBundle\Entity', $calls[0][1][1]); } diff --git a/Tests/DependencyInjection/Fixtures/Bundles/AttributesBundle/Entity/TestCustomIdGeneratorEntity.php b/Tests/DependencyInjection/Fixtures/Bundles/AttributesBundle/Entity/TestCustomIdGeneratorEntity.php index 513621537..44ea8a81d 100644 --- a/Tests/DependencyInjection/Fixtures/Bundles/AttributesBundle/Entity/TestCustomIdGeneratorEntity.php +++ b/Tests/DependencyInjection/Fixtures/Bundles/AttributesBundle/Entity/TestCustomIdGeneratorEntity.php @@ -8,6 +8,9 @@ #[ORM\Entity] class TestCustomIdGeneratorEntity { - #[ORM\Id, ORM\GeneratedValue(strategy: 'CUSTOM'), ORM\CustomIdGenerator('my_id_generator'), ORM\Column(type: Types::INTEGER)] + #[ORM\Id] + #[ORM\GeneratedValue(strategy: 'CUSTOM')] + #[ORM\CustomIdGenerator('my_id_generator')] + #[ORM\Column(type: Types::INTEGER)] public ?int $id = null; } diff --git a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomClassRepoEntity.php b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomClassRepoEntity.php index 60f80f7cd..e12b539a3 100644 --- a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomClassRepoEntity.php +++ b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomClassRepoEntity.php @@ -15,6 +15,8 @@ class TestCustomClassRepoEntity * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ - #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO'), ORM\Column(type: Types::INTEGER)] + #[ORM\Id] + #[ORM\GeneratedValue(strategy: 'AUTO')] + #[ORM\Column(type: Types::INTEGER)] private ?int $id = null; } diff --git a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomServiceRepoEntity.php b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomServiceRepoEntity.php index 76894a852..a5c2f8fe2 100644 --- a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomServiceRepoEntity.php +++ b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestCustomServiceRepoEntity.php @@ -15,6 +15,8 @@ class TestCustomServiceRepoEntity * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ - #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO'), ORM\Column(type: Types::INTEGER)] + #[ORM\Id] + #[ORM\GeneratedValue(strategy: 'AUTO')] + #[ORM\Column(type: Types::INTEGER)] private ?int $id = null; } diff --git a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestDefaultRepoEntity.php b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestDefaultRepoEntity.php index f44c3e57d..184c31d56 100644 --- a/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestDefaultRepoEntity.php +++ b/Tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Entity/TestDefaultRepoEntity.php @@ -14,6 +14,8 @@ class TestDefaultRepoEntity * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ - #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO'), ORM\Column(type: Types::INTEGER)] + #[ORM\Id] + #[ORM\GeneratedValue(strategy: 'AUTO')] + #[ORM\Column(type: Types::INTEGER)] private ?int $id = null; } diff --git a/Tests/DependencyInjection/Fixtures/CustomEntityListenerServiceResolver.php b/Tests/DependencyInjection/Fixtures/CustomEntityListenerServiceResolver.php index f7759fdf1..293c05a00 100644 --- a/Tests/DependencyInjection/Fixtures/CustomEntityListenerServiceResolver.php +++ b/Tests/DependencyInjection/Fixtures/CustomEntityListenerServiceResolver.php @@ -14,7 +14,7 @@ public function __construct(EntityListenerServiceResolver $resolver) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function clear($className = null): void { @@ -22,7 +22,7 @@ public function clear($className = null): void } /** - * {@inheritdoc} + * {@inheritDoc} */ public function resolve($className) { @@ -30,7 +30,7 @@ public function resolve($className) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function register($object): void { @@ -38,7 +38,7 @@ public function register($object): void } /** - * {@inheritdoc} + * {@inheritDoc} */ public function registerService($className, $serviceId): void { diff --git a/Tests/DependencyInjection/Fixtures/CustomIdGenerator.php b/Tests/DependencyInjection/Fixtures/CustomIdGenerator.php index cfe462eca..1621ae572 100644 --- a/Tests/DependencyInjection/Fixtures/CustomIdGenerator.php +++ b/Tests/DependencyInjection/Fixtures/CustomIdGenerator.php @@ -8,7 +8,7 @@ class CustomIdGenerator extends AbstractIdGenerator { /** - * {@inheritdoc} + * {@inheritDoc} */ public function generate(EntityManager $em, $entity) { diff --git a/Tests/DependencyInjection/TestFilter.php b/Tests/DependencyInjection/TestFilter.php index 6578359a0..5dea06e0d 100644 --- a/Tests/DependencyInjection/TestFilter.php +++ b/Tests/DependencyInjection/TestFilter.php @@ -10,7 +10,7 @@ class TestFilter extends SQLFilter /** * Gets the SQL query part to add to a query. * - * {@inheritdoc} + * {@inheritDoc} */ public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias): void { diff --git a/Tests/DependencyInjection/TestType.php b/Tests/DependencyInjection/TestType.php index 1a31eebfc..dea971abf 100644 --- a/Tests/DependencyInjection/TestType.php +++ b/Tests/DependencyInjection/TestType.php @@ -13,7 +13,7 @@ public function getName(): string } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform): string { diff --git a/Tests/LockStoreSchemaListenerTest.php b/Tests/LockStoreSchemaListenerTest.php index 6e9d52cc8..f2d62e345 100644 --- a/Tests/LockStoreSchemaListenerTest.php +++ b/Tests/LockStoreSchemaListenerTest.php @@ -57,7 +57,7 @@ public function testLockStoreSchemaSubscriberWiring(array $config, int $expected 'framework' => ['http_method_override' => false, 'php_errors' => ['log' => true]] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []) + $config, ], - $container + $container, ); $extension = new DoctrineExtension(); diff --git a/Tests/Mapping/DisconnectedMetadataFactoryTest.php b/Tests/Mapping/DisconnectedMetadataFactoryTest.php index ab61fffbb..daf574304 100644 --- a/Tests/Mapping/DisconnectedMetadataFactoryTest.php +++ b/Tests/Mapping/DisconnectedMetadataFactoryTest.php @@ -34,8 +34,7 @@ public function testCannotFindNamespaceAndPathForMetadata(): void $this->expectException(RuntimeException::class); $this->expectExceptionMessage(<<<'EXCEPTION' Can't find base path for "Doctrine\Bundle\DoctrineBundle\Tests\Mapping\DisconnectedMetadataFactoryTest -EXCEPTION - ); +EXCEPTION); $factory->findNamespaceAndPathForMetadata($collection); } diff --git a/Tests/Middleware/DebugMiddlewareTest.php b/Tests/Middleware/DebugMiddlewareTest.php index 29710e913..0609834e8 100644 --- a/Tests/Middleware/DebugMiddlewareTest.php +++ b/Tests/Middleware/DebugMiddlewareTest.php @@ -41,15 +41,14 @@ public function testData(): void 'memory' => true, ], $configuration); - $conn->executeQuery(<<executeQuery(<<<'EOT' CREATE TABLE products ( - id INTEGER PRIMARY KEY, - name TEXT NOT NULL, - price REAL NOT NULL, - stock INTEGER NOT NULL + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + price REAL NOT NULL, + stock INTEGER NOT NULL ); -EOT - ); +EOT); $data = $debugDataHolder->getData(); $this->assertCount(1, $data['default'] ?? []); diff --git a/Tests/ProfilerTest.php b/Tests/ProfilerTest.php index 1f53d8400..a1c1db920 100644 --- a/Tests/ProfilerTest.php +++ b/Tests/ProfilerTest.php @@ -108,7 +108,7 @@ public function testRender(): void $expectedEscapedSql = 'SELECT * FROM foo WHERE bar IN (?, ?) AND "" >= ""'; $this->assertSame( "SELECT\n *\nFROM\n foo\nWHERE\n bar IN (?, ?)\n AND \"\" >= \"\"", - html_entity_decode($expectedEscapedSql) + html_entity_decode($expectedEscapedSql), ); $this->assertStringContainsString($expectedEscapedSql, $output); @@ -116,7 +116,7 @@ public function testRender(): void $this->assertSame(1, preg_match('/' . str_replace( ' ', '.*', - preg_quote('SELECT * FROM foo WHERE bar IN ( ? , ? )') + preg_quote('SELECT * FROM foo WHERE bar IN ( ? , ? )'), ) . '/', $output)); } } diff --git a/Tests/RegistryTest.php b/Tests/RegistryTest.php index ebcecbdfc..b6246f336 100644 --- a/Tests/RegistryTest.php +++ b/Tests/RegistryTest.php @@ -104,7 +104,7 @@ public function testGetUnknownEntityManager(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( - 'Doctrine ORM Manager named "default" does not exist.' + 'Doctrine ORM Manager named "default" does not exist.', ); $registry->getManager('default'); } @@ -115,7 +115,7 @@ public function testResetUnknownEntityManager(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( - 'Doctrine ORM Manager named "default" does not exist.' + 'Doctrine ORM Manager named "default" does not exist.', ); $registry->resetManager('default'); } diff --git a/Tests/Repository/ContainerRepositoryFactoryTest.php b/Tests/Repository/ContainerRepositoryFactoryTest.php index ff53decd5..c4c4fccbf 100644 --- a/Tests/Repository/ContainerRepositoryFactoryTest.php +++ b/Tests/Repository/ContainerRepositoryFactoryTest.php @@ -75,8 +75,7 @@ public function testServiceRepositoriesMustExtendObjectRepository(): void $this->expectException(RuntimeException::class); $this->expectExceptionMessage(<<<'EXCEPTION' The service "my_repo" must implement ObjectRepository (or extend a base class, like ServiceEntityRepository). -EXCEPTION - ); +EXCEPTION); $factory->getRepository($em, 'Foo\CoolEntity'); } @@ -106,8 +105,7 @@ public function testRepositoryMatchesServiceInterfaceButServiceNotFound(): void $this->expectException(RuntimeException::class); $this->expectExceptionMessage(<<<'EXCEPTION' The "Doctrine\Bundle\DoctrineBundle\Tests\Repository\StubServiceRepository" entity repository implements "Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface", but its service could not be found. Make sure the service exists and is tagged with "doctrine.repository_service". -EXCEPTION - ); +EXCEPTION); $factory->getRepository($em, 'Foo\CoolEntity'); } @@ -121,8 +119,7 @@ public function testCustomRepositoryIsNotAValidClass(): void $this->expectException(RuntimeException::class); $this->expectExceptionMessage(<<<'EXCEPTION' The "Foo\CoolEntity" entity has a repositoryClass set to "not_a_real_class", but this is not a valid class. Check your class naming. If this is meant to be a service id, make sure this service exists and is tagged with "doctrine.repository_service". -EXCEPTION - ); +EXCEPTION); $factory->getRepository($em, 'Foo\CoolEntity'); } @@ -179,7 +176,7 @@ public function find($id) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function findAll(): array { @@ -187,7 +184,7 @@ public function findAll(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { diff --git a/Tests/Repository/ServiceEntityRepositoryTest.php b/Tests/Repository/ServiceEntityRepositoryTest.php index 0bf017355..97fb54a4d 100644 --- a/Tests/Repository/ServiceEntityRepositoryTest.php +++ b/Tests/Repository/ServiceEntityRepositoryTest.php @@ -29,8 +29,7 @@ public function testConstructorThrowsExceptionWhenNoManagerFound(): void $this->expectException(LogicException::class); $this->expectExceptionMessage(<<<'EXCEPTION' Could not find the entity manager for class "Doctrine\Bundle\DoctrineBundle\Tests\Repository\TestEntity". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata. -EXCEPTION - ); +EXCEPTION); /** @psalm-suppress UndefinedClass */ $repo = new ServiceEntityRepository($registry, TestEntity::class); $repo->getClassName(); diff --git a/Tests/Twig/DoctrineExtensionTest.php b/Tests/Twig/DoctrineExtensionTest.php index e8c502cc9..25c01babf 100644 --- a/Tests/Twig/DoctrineExtensionTest.php +++ b/Tests/Twig/DoctrineExtensionTest.php @@ -109,11 +109,11 @@ public function testItHighlightsSqlQueriesUsingCssClasses(): void $extension = new DoctrineExtension(); self::assertStringContainsString( 'class=', - $extension->formatQuery('CREATE DATABASE πŸ“š;') + $extension->formatQuery('CREATE DATABASE πŸ“š;'), ); self::assertStringContainsString( 'class=', - $extension->formatSql('CREATE DATABASE πŸ“š;', true) + $extension->formatSql('CREATE DATABASE πŸ“š;', true), ); } @@ -123,11 +123,11 @@ public function testItDoesNotOutputDuplicatePreTags(): void $extension = new DoctrineExtension(); self::assertSame( 1, - substr_count($extension->formatQuery('CREATE DATABASE πŸ“š;'), 'formatQuery('CREATE DATABASE πŸ“š;'), 'formatSQL('CREATE DATABASE πŸ“š;', true), 'formatSQL('CREATE DATABASE πŸ“š;', true), 'formatQuery('CREATE DATABASE πŸ“š;'), '
') + substr_count($extension->formatQuery('CREATE DATABASE πŸ“š;'), '
'),
         );
     }
 
@@ -150,7 +150,7 @@ public function testItUsesCssOnThePreTag(): void
         $extension = new DoctrineExtension();
         self::assertSame(
             1,
-            substr_count($extension->formatSQL('CREATE DATABASE πŸ“š;', true), '
getParams(),
-                $expectedParams
-            )
+                $expectedParams,
+            ),
         );
     }
 
diff --git a/Twig/DoctrineExtension.php b/Twig/DoctrineExtension.php
index aea534ebb..063681a44 100644
--- a/Twig/DoctrineExtension.php
+++ b/Twig/DoctrineExtension.php
@@ -130,7 +130,7 @@ static function ($matches) use ($parameters, &$i) {
 
                 return $result;
             },
-            $query
+            $query,
         );
     }
 
@@ -148,7 +148,7 @@ public function formatQuery($sql, $highlightOnly = false)
             'doctrine/doctrine-bundle',
             '2.1',
             'The "%s()" method is deprecated and will be removed in doctrine-bundle 3.0.',
-            __METHOD__
+            __METHOD__,
         );
 
         $this->setUpSqlFormatter(true, true);
@@ -159,7 +159,7 @@ public function formatQuery($sql, $highlightOnly = false)
 
         return sprintf(
             '
%s
', - $this->sqlFormatter->format($sql) + $this->sqlFormatter->format($sql), ); } diff --git a/composer.json b/composer.json index 2286e54b1..e7128d397 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ }, "require-dev": { "doctrine/annotations": "^1 || ^2", - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^12", "doctrine/deprecations": "^1.0", "doctrine/orm": "^2.14 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0",