@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Pagination; |
| 6 | 6 | |
@@ -187,13 +187,13 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $innerSql = $this->getInnerSQL($AST); |
| 189 | 189 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 190 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 190 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 191 | 191 | return $info['alias']; |
| 192 | 192 | }, $sqlIdentifier); |
| 193 | 193 | |
| 194 | 194 | if ($hasOrderBy) { |
| 195 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
| 196 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
| 195 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
| 196 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
| 197 | 197 | |
| 198 | 198 | $sqlAliasIdentifier[] = $sqlPiece; |
| 199 | 199 | $sqlIdentifier[] = [ |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
| 207 | 207 | |
| 208 | 208 | if ($hasOrderBy) { |
| 209 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
| 209 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | // Apply the limit and offset. |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | $innerSql = $this->getInnerSQL($AST); |
| 252 | 252 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 253 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 253 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 254 | 254 | return $info['alias']; |
| 255 | 255 | }, $sqlIdentifier); |
| 256 | 256 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $idVar = $pathExpression->identificationVariable; |
| 309 | 309 | $field = $pathExpression->field; |
| 310 | 310 | |
| 311 | - if (! isset($selects[$idVar])) { |
|
| 311 | + if ( ! isset($selects[$idVar])) { |
|
| 312 | 312 | $selects[$idVar] = []; |
| 313 | 313 | } |
| 314 | 314 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | if ($selectExpression instanceof SelectExpression) { |
| 322 | 322 | $idVar = $selectExpression->expression; |
| 323 | 323 | |
| 324 | - if (! is_string($idVar)) { |
|
| 324 | + if ( ! is_string($idVar)) { |
|
| 325 | 325 | continue; |
| 326 | 326 | } |
| 327 | 327 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | ?OrderByClause $orderByClause |
| 357 | 357 | ) : string { |
| 358 | 358 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
| 359 | - if (! $orderByClause) { |
|
| 359 | + if ( ! $orderByClause) { |
|
| 360 | 360 | return $sql; |
| 361 | 361 | } |
| 362 | 362 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $orderByItems[] = $orderByItemString; |
| 395 | 395 | $identifier = \substr($orderByItemString, 0, \strrpos($orderByItemString, ' ')); |
| 396 | 396 | |
| 397 | - if (! \in_array($identifier, $identifiers, true)) { |
|
| 397 | + if ( ! \in_array($identifier, $identifiers, true)) { |
|
| 398 | 398 | $identifiers[] = $identifier; |
| 399 | 399 | } |
| 400 | 400 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | */ |
| 548 | 548 | public function walkPathExpression($pathExpr) |
| 549 | 549 | { |
| 550 | - if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) { |
|
| 550 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) { |
|
| 551 | 551 | $this->orderByPathExpressions[] = $pathExpr; |
| 552 | 552 | } |
| 553 | 553 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Pagination; |
| 6 | 6 | |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function getSql(SqlWalker $sqlWalker) |
| 29 | 29 | { |
| 30 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
| 30 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
| 31 | 31 | $this->orderByClause |
| 32 | - )) . ')'; |
|
| 32 | + )).')'; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $depth = $input->getOption('depth'); |
| 52 | 52 | |
| 53 | - if (! is_numeric($depth)) { |
|
| 53 | + if ( ! is_numeric($depth)) { |
|
| 54 | 54 | throw new \LogicException("Option 'depth' must contain an integer value"); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $hydrationModeName = $input->getOption('hydrate'); |
| 58 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
| 58 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
| 59 | 59 | |
| 60 | - if (! defined($hydrationMode)) { |
|
| 60 | + if ( ! defined($hydrationMode)) { |
|
| 61 | 61 | throw new \RuntimeException(sprintf( |
| 62 | 62 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
| 63 | 63 | $hydrationModeName |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $firstResult = $input->getOption('first-result'); |
| 69 | 69 | |
| 70 | 70 | if ($firstResult !== null) { |
| 71 | - if (! is_numeric($firstResult)) { |
|
| 71 | + if ( ! is_numeric($firstResult)) { |
|
| 72 | 72 | throw new \LogicException("Option 'first-result' must contain an integer value"); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $maxResult = $input->getOption('max-result'); |
| 79 | 79 | |
| 80 | 80 | if ($maxResult !== null) { |
| 81 | - if (! is_numeric($maxResult)) { |
|
| 81 | + if ( ! is_numeric($maxResult)) { |
|
| 82 | 82 | throw new \LogicException("Option 'max-result' must contain an integer value"); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $ui->text('<comment>[SKIPPED] The mapping was not checked.</comment>'); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (! $skipMapping) { |
|
| 48 | + if ( ! $skipMapping) { |
|
| 49 | 49 | $errors = $validator->validateMapping(); |
| 50 | 50 | |
| 51 | 51 | if ($errors) { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | if ($input->getOption('skip-sync')) { |
| 73 | 73 | $ui->text('<comment>[SKIPPED] The database was not checked for synchronicity.</comment>'); |
| 74 | - } elseif (! $validator->schemaInSyncWithMetadata()) { |
|
| 74 | + } elseif ( ! $validator->schemaInSyncWithMetadata()) { |
|
| 75 | 75 | $ui->error('The database schema is not in sync with the current mapping file.'); |
| 76 | 76 | $exit += 2; |
| 77 | 77 | } else { |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | protected function configure() |
| 31 | 31 | { |
| 32 | 32 | $this->setName('orm:mapping:describe') |
| 33 | - ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
| 34 | - ->setDescription('Display information about mapped objects') |
|
| 35 | - ->setHelp(<<<'EOT' |
|
| 33 | + ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
| 34 | + ->setDescription('Display information about mapped objects') |
|
| 35 | + ->setHelp(<<<'EOT' |
|
| 36 | 36 | The %command.full_name% command describes the metadata for the given full or partial entity class name. |
| 37 | 37 | |
| 38 | 38 | <info>%command.full_name%</info> My\Namespace\Entity\MyEntity |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | <info>%command.full_name%</info> MyEntity |
| 43 | 43 | EOT |
| 44 | - ); |
|
| 44 | + ); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | private function getMappedEntities(EntityManagerInterface $entityManager) |
| 122 | 122 | { |
| 123 | 123 | $entityClassNames = $entityManager->getConfiguration() |
| 124 | - ->getMetadataDriverImpl() |
|
| 125 | - ->getAllClassNames(); |
|
| 124 | + ->getMetadataDriverImpl() |
|
| 125 | + ->getAllClassNames(); |
|
| 126 | 126 | |
| 127 | 127 | if (! $entityClassNames) { |
| 128 | 128 | throw new \InvalidArgumentException( |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | ->getMetadataDriverImpl() |
| 125 | 125 | ->getAllClassNames(); |
| 126 | 126 | |
| 127 | - if (! $entityClassNames) { |
|
| 127 | + if ( ! $entityClassNames) { |
|
| 128 | 128 | throw new \InvalidArgumentException( |
| 129 | - 'You do not have any mapped Doctrine ORM entities according to the current configuration. ' . |
|
| 129 | + 'You do not have any mapped Doctrine ORM entities according to the current configuration. '. |
|
| 130 | 130 | 'If you have entities or mapping files you should check your mapping configuration for errors.' |
| 131 | 131 | ); |
| 132 | 132 | } |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | $matches = array_filter( |
| 153 | 153 | $this->getMappedEntities($entityManager), |
| 154 | - function ($mappedEntity) use ($entityName) { |
|
| 155 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
| 154 | + function($mappedEntity) use ($entityName) { |
|
| 155 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
| 156 | 156 | } |
| 157 | 157 | ); |
| 158 | 158 | |
| 159 | - if (! $matches) { |
|
| 159 | + if ( ! $matches) { |
|
| 160 | 160 | throw new \InvalidArgumentException(sprintf( |
| 161 | 161 | 'Could not find any mapped Entity classes matching "%s"', |
| 162 | 162 | $entityName |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | $output[] = $this->formatField( |
| 210 | 210 | sprintf(' %s', $parentClass->getParent()), |
| 211 | - ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes) |
|
| 211 | + ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes) |
|
| 212 | 212 | ); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | if (is_bool($value)) { |
| 236 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
| 236 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if (empty($value)) { |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -50,19 +50,19 @@ discard block |
||
| 50 | 50 | $destPath = $em->getConfiguration()->getProxyDir(); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (! is_dir($destPath)) { |
|
| 53 | + if ( ! is_dir($destPath)) { |
|
| 54 | 54 | mkdir($destPath, 0775, true); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $destPath = realpath($destPath); |
| 58 | 58 | |
| 59 | - if (! file_exists($destPath)) { |
|
| 59 | + if ( ! file_exists($destPath)) { |
|
| 60 | 60 | throw new \InvalidArgumentException( |
| 61 | 61 | sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $em->getConfiguration()->getProxyDir()) |
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (! is_writable($destPath)) { |
|
| 65 | + if ( ! is_writable($destPath)) { |
|
| 66 | 66 | throw new \InvalidArgumentException( |
| 67 | 67 | sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath) |
| 68 | 68 | ); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command\ClearCache; |
| 6 | 6 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $name = Cache::DEFAULT_QUERY_REGION_NAME; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (! $cache instanceof Cache) { |
|
| 73 | + if ( ! $cache instanceof Cache) { |
|
| 74 | 74 | throw new \InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $queryCache = $cache->getQueryCache($name); |
| 79 | 79 | $queryRegion = $queryCache->getRegion(); |
| 80 | 80 | |
| 81 | - if (! $queryRegion instanceof DefaultRegion) { |
|
| 81 | + if ( ! $queryRegion instanceof DefaultRegion) { |
|
| 82 | 82 | throw new \InvalidArgumentException(sprintf( |
| 83 | 83 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
| 84 | 84 | is_object($queryRegion) ? get_class($queryRegion) : gettype($queryRegion) |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command\ClearCache; |
| 6 | 6 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $em = $this->getHelper('em')->getEntityManager(); |
| 56 | 56 | $cacheDriver = $em->getConfiguration()->getResultCacheImpl(); |
| 57 | 57 | |
| 58 | - if (! $cacheDriver) { |
|
| 58 | + if ( ! $cacheDriver) { |
|
| 59 | 59 | throw new \InvalidArgumentException('No Result cache driver is configured on given EntityManager.'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $message = ($result) ? 'Successfully flushed cache entries.' : $message; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (! $result) { |
|
| 80 | + if ( ! $result) { |
|
| 81 | 81 | $ui->error($message); |
| 82 | 82 | |
| 83 | 83 | return 1; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command\ClearCache; |
| 6 | 6 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $ownerId = $input->getArgument('owner-id'); |
| 71 | 71 | $cache = $em->getCache(); |
| 72 | 72 | |
| 73 | - if (! $cache instanceof Cache) { |
|
| 73 | + if ( ! $cache instanceof Cache) { |
|
| 74 | 74 | throw new \InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if ($input->getOption('flush')) { |
| 82 | 82 | $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc); |
| 83 | 83 | |
| 84 | - if (! $collectionRegion instanceof DefaultRegion) { |
|
| 84 | + if ( ! $collectionRegion instanceof DefaultRegion) { |
|
| 85 | 85 | throw new \InvalidArgumentException(sprintf( |
| 86 | 86 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
| 87 | 87 | is_object($collectionRegion) ? get_class($collectionRegion) : gettype($collectionRegion) |