@@ -50,19 +50,19 @@ |
||
| 50 | 50 | $this->em->clear(); |
| 51 | 51 | |
| 52 | 52 | $result = $this->em->createQueryBuilder() |
| 53 | - ->select('p') |
|
| 54 | - ->from(DDC3170ProductJoined::class, 'p') |
|
| 55 | - ->getQuery() |
|
| 56 | - ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); |
|
| 53 | + ->select('p') |
|
| 54 | + ->from(DDC3170ProductJoined::class, 'p') |
|
| 55 | + ->getQuery() |
|
| 56 | + ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); |
|
| 57 | 57 | |
| 58 | 58 | self::assertCount(1, $result); |
| 59 | 59 | self::assertContainsOnly(DDC3170ProductJoined::class, $result); |
| 60 | 60 | |
| 61 | 61 | $result = $this->em->createQueryBuilder() |
| 62 | - ->select('p') |
|
| 63 | - ->from(DDC3170ProductSingleTable::class, 'p') |
|
| 64 | - ->getQuery() |
|
| 65 | - ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); |
|
| 62 | + ->select('p') |
|
| 63 | + ->from(DDC3170ProductSingleTable::class, 'p') |
|
| 64 | + ->getQuery() |
|
| 65 | + ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); |
|
| 66 | 66 | |
| 67 | 67 | self::assertCount(1, $result); |
| 68 | 68 | self::assertContainsOnly(DDC3170ProductSingleTable::class, $result); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $product->addBuyer($user); |
| 36 | 36 | |
| 37 | 37 | $this->em->getUnitOfWork() |
| 38 | - ->computeChangeSets(); |
|
| 38 | + ->computeChangeSets(); |
|
| 39 | 39 | |
| 40 | 40 | $this->em->persist($product); |
| 41 | 41 | $this->em->flush(); |
@@ -213,8 +213,8 @@ |
||
| 213 | 213 | $this->metadataCache = []; |
| 214 | 214 | |
| 215 | 215 | $this->em |
| 216 | - ->getEventManager() |
|
| 217 | - ->removeEventListener([Events::onClear], $this); |
|
| 216 | + ->getEventManager() |
|
| 217 | + ->removeEventListener([Events::onClear], $this); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $row = $this->stmt->fetch(FetchMode::ASSOCIATIVE); |
| 152 | 152 | |
| 153 | - if (! $row) { |
|
| 153 | + if ( ! $row) { |
|
| 154 | 154 | $this->cleanup(); |
| 155 | 155 | |
| 156 | 156 | return false; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | : $value; |
| 293 | 293 | |
| 294 | 294 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
| 295 | - $id[$dqlAlias] .= '|' . $value; |
|
| 295 | + $id[$dqlAlias] .= '|'.$value; |
|
| 296 | 296 | $nonemptyComponents[$dqlAlias] = true; |
| 297 | 297 | } |
| 298 | 298 | break; |
@@ -328,10 +328,10 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | // WARNING: BC break! We know this is the desired behavior to type convert values, but this |
| 330 | 330 | // erroneous behavior exists since 2.0 and we're forced to keep compatibility. |
| 331 | - if (! isset($cacheKeyInfo['isScalar'])) { |
|
| 331 | + if ( ! isset($cacheKeyInfo['isScalar'])) { |
|
| 332 | 332 | $dqlAlias = $cacheKeyInfo['dqlAlias']; |
| 333 | 333 | $type = $cacheKeyInfo['type']; |
| 334 | - $fieldName = $dqlAlias . '_' . $fieldName; |
|
| 334 | + $fieldName = $dqlAlias.'_'.$fieldName; |
|
| 335 | 335 | $value = $type |
| 336 | 336 | ? $type->convertToPHPValue($value, $this->platform) |
| 337 | 337 | : $value; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | private function getDiscriminatorValues(ClassMetadata $classMetadata) : array |
| 436 | 436 | { |
| 437 | 437 | $values = array_map( |
| 438 | - function (string $subClass) : string { |
|
| 438 | + function(string $subClass) : string { |
|
| 439 | 439 | return (string) $this->getClassMetadata($subClass)->discriminatorValue; |
| 440 | 440 | }, |
| 441 | 441 | $classMetadata->getSubClasses() |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | protected function getClassMetadata($className) |
| 457 | 457 | { |
| 458 | - if (! isset($this->metadataCache[$className])) { |
|
| 458 | + if ( ! isset($this->metadataCache[$className])) { |
|
| 459 | 459 | $this->metadataCache[$className] = $this->em->getClassMetadata($className); |
| 460 | 460 | } |
| 461 | 461 | |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $em = $this->createMock(EntityManagerInterface::class); |
| 61 | 61 | |
| 62 | 62 | $mappingDriver->method('getAllClassNames') |
| 63 | - ->willReturn([]); |
|
| 63 | + ->willReturn([]); |
|
| 64 | 64 | |
| 65 | 65 | $configuration->method('getMetadataDriverImpl') |
| 66 | - ->willReturn($mappingDriver); |
|
| 66 | + ->willReturn($mappingDriver); |
|
| 67 | 67 | |
| 68 | 68 | $em->method('getConfiguration') |
| 69 | - ->willReturn($configuration); |
|
| 69 | + ->willReturn($configuration); |
|
| 70 | 70 | |
| 71 | 71 | $application = new Application(); |
| 72 | 72 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -95,17 +95,17 @@ discard block |
||
| 95 | 95 | $em = $this->createMock(EntityManagerInterface::class); |
| 96 | 96 | |
| 97 | 97 | $mappingDriver->method('getAllClassNames') |
| 98 | - ->willReturn(['InvalidEntity']); |
|
| 98 | + ->willReturn(['InvalidEntity']); |
|
| 99 | 99 | |
| 100 | 100 | $configuration->method('getMetadataDriverImpl') |
| 101 | - ->willReturn($mappingDriver); |
|
| 101 | + ->willReturn($mappingDriver); |
|
| 102 | 102 | |
| 103 | 103 | $em->method('getConfiguration') |
| 104 | - ->willReturn($configuration); |
|
| 104 | + ->willReturn($configuration); |
|
| 105 | 105 | |
| 106 | 106 | $em->method('getClassMetadata') |
| 107 | - ->with('InvalidEntity') |
|
| 108 | - ->willThrowException(new MappingException('exception message')); |
|
| 107 | + ->with('InvalidEntity') |
|
| 108 | + ->willThrowException(new MappingException('exception message')); |
|
| 109 | 109 | |
| 110 | 110 | $application = new Application(); |
| 111 | 111 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $this->tester->execute( |
| 63 | 63 | [ |
| 64 | 64 | 'command' => $this->command->getName(), |
| 65 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
| 65 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
| 66 | 66 | ] |
| 67 | 67 | ) |
| 68 | 68 | ); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->tester->execute( |
| 81 | 81 | [ |
| 82 | 82 | 'command' => $this->command->getName(), |
| 83 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
| 83 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
| 84 | 84 | '--show-sql' => 'true', |
| 85 | 85 | ] |
| 86 | 86 | ) |
@@ -45,14 +45,14 @@ |
||
| 45 | 45 | protected function configure() |
| 46 | 46 | { |
| 47 | 47 | $this->setName('orm:run-dql') |
| 48 | - ->setDescription('Executes arbitrary DQL directly from the command line') |
|
| 49 | - ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
| 50 | - ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
| 51 | - ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
| 52 | - ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
| 53 | - ->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of Entity graph.', 7) |
|
| 54 | - ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
| 55 | - ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
| 48 | + ->setDescription('Executes arbitrary DQL directly from the command line') |
|
| 49 | + ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
| 50 | + ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
| 51 | + ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
| 52 | + ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
| 53 | + ->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of Entity graph.', 7) |
|
| 54 | + ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
| 55 | + ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $depth = $input->getOption('depth'); |
| 61 | 61 | |
| 62 | - if (! is_numeric($depth)) { |
|
| 62 | + if ( ! is_numeric($depth)) { |
|
| 63 | 63 | throw new LogicException("Option 'depth' must contain an integer value"); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $hydrationModeName = $input->getOption('hydrate'); |
| 67 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
| 67 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
| 68 | 68 | |
| 69 | - if (! defined($hydrationMode)) { |
|
| 69 | + if ( ! defined($hydrationMode)) { |
|
| 70 | 70 | throw new RuntimeException(sprintf( |
| 71 | 71 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
| 72 | 72 | $hydrationModeName |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $firstResult = $input->getOption('first-result'); |
| 78 | 78 | |
| 79 | 79 | if ($firstResult !== null) { |
| 80 | - if (! is_numeric($firstResult)) { |
|
| 80 | + if ( ! is_numeric($firstResult)) { |
|
| 81 | 81 | throw new LogicException("Option 'first-result' must contain an integer value"); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $maxResult = $input->getOption('max-result'); |
| 88 | 88 | |
| 89 | 89 | if ($maxResult !== null) { |
| 90 | - if (! is_numeric($maxResult)) { |
|
| 90 | + if ( ! is_numeric($maxResult)) { |
|
| 91 | 91 | throw new LogicException("Option 'max-result' must contain an integer value"); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -45,10 +45,10 @@ |
||
| 45 | 45 | protected function configure() |
| 46 | 46 | { |
| 47 | 47 | $this->setName('orm:validate-schema') |
| 48 | - ->setDescription('Validate the mapping files') |
|
| 49 | - ->addOption('skip-mapping', null, InputOption::VALUE_NONE, 'Skip the mapping validation check') |
|
| 50 | - ->addOption('skip-sync', null, InputOption::VALUE_NONE, 'Skip checking if the mapping is in sync with the database') |
|
| 51 | - ->setHelp('Validate that the mapping files are correct and in sync with the database.'); |
|
| 48 | + ->setDescription('Validate the mapping files') |
|
| 49 | + ->addOption('skip-mapping', null, InputOption::VALUE_NONE, 'Skip the mapping validation check') |
|
| 50 | + ->addOption('skip-sync', null, InputOption::VALUE_NONE, 'Skip checking if the mapping is in sync with the database') |
|
| 51 | + ->setHelp('Validate that the mapping files are correct and in sync with the database.'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $ui->text('<comment>[SKIPPED] The mapping was not checked.</comment>'); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if (! $skipMapping) { |
|
| 49 | + if ( ! $skipMapping) { |
|
| 50 | 50 | $errors = $validator->validateMapping(); |
| 51 | 51 | |
| 52 | 52 | if ($errors) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($input->getOption('skip-sync')) { |
| 74 | 74 | $ui->text('<comment>[SKIPPED] The database was not checked for synchronicity.</comment>'); |
| 75 | - } elseif (! $validator->schemaInSyncWithMetadata()) { |
|
| 75 | + } elseif ( ! $validator->schemaInSyncWithMetadata()) { |
|
| 76 | 76 | $ui->error('The database schema is not in sync with the current mapping file.'); |
| 77 | 77 | $exit += 2; |
| 78 | 78 | } else { |
@@ -45,9 +45,9 @@ |
||
| 45 | 45 | protected function configure() |
| 46 | 46 | { |
| 47 | 47 | $this->setName('orm:ensure-production-settings') |
| 48 | - ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
| 49 | - ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
| 50 | - ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
| 48 | + ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
| 49 | + ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
| 50 | + ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | protected function configure() |
| 47 | 47 | { |
| 48 | 48 | $this->setName('orm:generate-proxies') |
| 49 | - ->setAliases(['orm:generate:proxies']) |
|
| 50 | - ->setDescription('Generates proxy classes for entity classes') |
|
| 51 | - ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
| 52 | - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
| 53 | - ->setHelp('Generates proxy classes for entity classes.'); |
|
| 49 | + ->setAliases(['orm:generate:proxies']) |
|
| 50 | + ->setDescription('Generates proxy classes for entity classes') |
|
| 51 | + ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
| 52 | + ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
| 53 | + ->setHelp('Generates proxy classes for entity classes.'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -57,19 +57,19 @@ |
||
| 57 | 57 | $destPath = $em->getConfiguration()->getProxyDir(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (! is_dir($destPath)) { |
|
| 60 | + if ( ! is_dir($destPath)) { |
|
| 61 | 61 | mkdir($destPath, 0775, true); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $destPath = realpath($destPath); |
| 65 | 65 | |
| 66 | - if (! file_exists($destPath)) { |
|
| 66 | + if ( ! file_exists($destPath)) { |
|
| 67 | 67 | throw new InvalidArgumentException( |
| 68 | 68 | sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $em->getConfiguration()->getProxyDir()) |
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if (! is_writable($destPath)) { |
|
| 72 | + if ( ! is_writable($destPath)) { |
|
| 73 | 73 | throw new InvalidArgumentException( |
| 74 | 74 | sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath) |
| 75 | 75 | ); |