@@ -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\Tests\ORM\Query; |
| 6 | 6 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | 9 => "St Julien" |
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | - $query = $this->em |
|
| 169 | + $query = $this->em |
|
| 170 | 170 | ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)") |
| 171 | 171 | ->setParameter('cities', $cities); |
| 172 | 172 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function testProcessParameterValueClassMetadata() |
| 184 | 184 | { |
| 185 | - $query = $this->em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
| 185 | + $query = $this->em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
| 186 | 186 | self::assertEquals( |
| 187 | 187 | CmsAddress::class, |
| 188 | 188 | $query->processParameterValue($this->em->getClassMetadata(CmsAddress::class)) |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | */ |
| 317 | 317 | public function testGetParameterTypeJuggling() : void |
| 318 | 318 | { |
| 319 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0'); |
|
| 319 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0'); |
|
| 320 | 320 | |
| 321 | 321 | $query->setParameter(0, 0); |
| 322 | 322 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | public function testSetParameterWithNameZeroIsNotOverridden() : void |
| 332 | 332 | { |
| 333 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 333 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 334 | 334 | |
| 335 | 335 | $query->setParameter(0, 0); |
| 336 | 336 | $query->setParameter('name', 'Doctrine'); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void |
| 347 | 347 | { |
| 348 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 348 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 349 | 349 | |
| 350 | 350 | $query->setParameter('name', 'Doctrine'); |
| 351 | 351 | $query->setParameter(0, 0); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | */ |
| 361 | 361 | public function testSetParameterWithTypeJugglingWorks() : void |
| 362 | 362 | { |
| 363 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 363 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 364 | 364 | |
| 365 | 365 | $query->setParameter('0', 1); |
| 366 | 366 | $query->setParameter('name', 'Doctrine'); |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | { |
| 275 | 275 | $qb = $this->em->createQueryBuilder(); |
| 276 | 276 | $qb->select('u') |
| 277 | - ->from(CmsUser::class, 'u') |
|
| 278 | - ->where('u.id = :uid') |
|
| 279 | - ->orWhere('u.id = :uid2') |
|
| 280 | - ->andWhere('u.id = :uid3') |
|
| 281 | - ->orWhere('u.name = :name1', 'u.name = :name2') |
|
| 282 | - ->andWhere('u.name <> :noname'); |
|
| 277 | + ->from(CmsUser::class, 'u') |
|
| 278 | + ->where('u.id = :uid') |
|
| 279 | + ->orWhere('u.id = :uid2') |
|
| 280 | + ->andWhere('u.id = :uid3') |
|
| 281 | + ->orWhere('u.name = :name1', 'u.name = :name2') |
|
| 282 | + ->andWhere('u.name <> :noname'); |
|
| 283 | 283 | |
| 284 | 284 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (((u.id = :uid OR u.id = :uid2) AND u.id = :uid3) OR u.name = :name1 OR u.name = :name2) AND u.name <> :noname'); |
| 285 | 285 | } |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | { |
| 289 | 289 | $qb = $this->em->createQueryBuilder(); |
| 290 | 290 | $qb->select('u') |
| 291 | - ->from(CmsUser::class, 'u') |
|
| 292 | - ->where('u.id = :uid') |
|
| 293 | - ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 291 | + ->from(CmsUser::class, 'u') |
|
| 292 | + ->where('u.id = :uid') |
|
| 293 | + ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 294 | 294 | |
| 295 | 295 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id IN(1, 2, 3)'); |
| 296 | 296 | } |
@@ -299,9 +299,9 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | $qb = $this->em->createQueryBuilder(); |
| 301 | 301 | $qb->select('u') |
| 302 | - ->from(CmsUser::class, 'u') |
|
| 303 | - ->where('u.id = :uid') |
|
| 304 | - ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 302 | + ->from(CmsUser::class, 'u') |
|
| 303 | + ->where('u.id = :uid') |
|
| 304 | + ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 305 | 305 | |
| 306 | 306 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id IN(1, 2, 3)'); |
| 307 | 307 | } |
@@ -310,9 +310,9 @@ discard block |
||
| 310 | 310 | { |
| 311 | 311 | $qb = $this->em->createQueryBuilder(); |
| 312 | 312 | $qb->select('u') |
| 313 | - ->from(CmsUser::class, 'u') |
|
| 314 | - ->where('u.id = :uid') |
|
| 315 | - ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 313 | + ->from(CmsUser::class, 'u') |
|
| 314 | + ->where('u.id = :uid') |
|
| 315 | + ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 316 | 316 | |
| 317 | 317 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id NOT IN(1, 2, 3)'); |
| 318 | 318 | } |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | { |
| 322 | 322 | $qb = $this->em->createQueryBuilder(); |
| 323 | 323 | $qb->select('u') |
| 324 | - ->from(CmsUser::class, 'u') |
|
| 325 | - ->where('u.id = :uid') |
|
| 326 | - ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 324 | + ->from(CmsUser::class, 'u') |
|
| 325 | + ->where('u.id = :uid') |
|
| 326 | + ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 327 | 327 | |
| 328 | 328 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id NOT IN(1, 2, 3)'); |
| 329 | 329 | } |
@@ -619,8 +619,8 @@ discard block |
||
| 619 | 619 | { |
| 620 | 620 | $qb = $this->em->createQueryBuilder(); |
| 621 | 621 | $qb->select('u') |
| 622 | - ->from(CmsUser::class, 'u') |
|
| 623 | - ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
| 622 | + ->from(CmsUser::class, 'u') |
|
| 623 | + ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
| 624 | 624 | |
| 625 | 625 | $parameters = new ArrayCollection(); |
| 626 | 626 | $parameters->add(new Parameter('username', 'jwage')); |
@@ -636,8 +636,8 @@ discard block |
||
| 636 | 636 | { |
| 637 | 637 | $qb = $this->em->createQueryBuilder(); |
| 638 | 638 | $qb->select('u') |
| 639 | - ->from(CmsUser::class, 'u') |
|
| 640 | - ->where('u.id = :id'); |
|
| 639 | + ->from(CmsUser::class, 'u') |
|
| 640 | + ->where('u.id = :id'); |
|
| 641 | 641 | |
| 642 | 642 | $parameters = new ArrayCollection(); |
| 643 | 643 | $parameters->add(new Parameter('id', 1)); |
@@ -686,8 +686,8 @@ discard block |
||
| 686 | 686 | { |
| 687 | 687 | $qb = $this->em->createQueryBuilder(); |
| 688 | 688 | $qb->select('u') |
| 689 | - ->from(CmsUser::class, 'u') |
|
| 690 | - ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
| 689 | + ->from(CmsUser::class, 'u') |
|
| 690 | + ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
| 691 | 691 | |
| 692 | 692 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2'); |
| 693 | 693 | } |
@@ -700,8 +700,8 @@ discard block |
||
| 700 | 700 | $orExpr->add($qb->expr()->in('u.id', [1])); |
| 701 | 701 | |
| 702 | 702 | $qb->select('u') |
| 703 | - ->from(CmsUser::class, 'u') |
|
| 704 | - ->where($orExpr); |
|
| 703 | + ->from(CmsUser::class, 'u') |
|
| 704 | + ->where($orExpr); |
|
| 705 | 705 | |
| 706 | 706 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR u.id IN(1)'); |
| 707 | 707 | } |
@@ -710,8 +710,8 @@ discard block |
||
| 710 | 710 | { |
| 711 | 711 | $qb = $this->em->createQueryBuilder(); |
| 712 | 712 | $qb->select('u') |
| 713 | - ->from(CmsUser::class, 'u') |
|
| 714 | - ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
| 713 | + ->from(CmsUser::class, 'u') |
|
| 714 | + ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
| 715 | 715 | |
| 716 | 716 | self::assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
| 717 | 717 | |
@@ -725,8 +725,8 @@ discard block |
||
| 725 | 725 | $qb = $this->em->createQueryBuilder(); |
| 726 | 726 | $expr = $this->em->getExpressionBuilder(); |
| 727 | 727 | $qb->select('u') |
| 728 | - ->from(CmsUser::class, 'u') |
|
| 729 | - ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
| 728 | + ->from(CmsUser::class, 'u') |
|
| 729 | + ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
| 730 | 730 | |
| 731 | 731 | self::assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
| 732 | 732 | |
@@ -744,8 +744,8 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | $qb = $this->em->createQueryBuilder(); |
| 746 | 746 | $qb->select('u') |
| 747 | - ->from(CmsUser::class, 'u') |
|
| 748 | - ->where($orExpr); |
|
| 747 | + ->from(CmsUser::class, 'u') |
|
| 748 | + ->where($orExpr); |
|
| 749 | 749 | |
| 750 | 750 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR NOT(u.id IN(1))'); |
| 751 | 751 | } |
@@ -756,8 +756,8 @@ discard block |
||
| 756 | 756 | $expr = $this->em->getExpressionBuilder(); |
| 757 | 757 | |
| 758 | 758 | $qb->select('u') |
| 759 | - ->from(CmsUser::class, 'u') |
|
| 760 | - ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
| 759 | + ->from(CmsUser::class, 'u') |
|
| 760 | + ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
| 761 | 761 | |
| 762 | 762 | self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL(select a.id from Doctrine\Tests\Models\CMS\CmsArticle a)'); |
| 763 | 763 | |
@@ -1123,9 +1123,9 @@ discard block |
||
| 1123 | 1123 | public function testRebuildsFromParts() |
| 1124 | 1124 | { |
| 1125 | 1125 | $qb = $this->em->createQueryBuilder() |
| 1126 | - ->select('u') |
|
| 1127 | - ->from(CmsUser::class, 'u') |
|
| 1128 | - ->join('u.article', 'a'); |
|
| 1126 | + ->select('u') |
|
| 1127 | + ->from(CmsUser::class, 'u') |
|
| 1128 | + ->join('u.article', 'a'); |
|
| 1129 | 1129 | |
| 1130 | 1130 | $dqlParts = $qb->getDQLParts(); |
| 1131 | 1131 | $dql = $qb->getDQL(); |
@@ -1167,9 +1167,9 @@ discard block |
||
| 1167 | 1167 | public function testGetParameterTypeJuggling() : void |
| 1168 | 1168 | { |
| 1169 | 1169 | $builder = $this->_em->createQueryBuilder() |
| 1170 | - ->select('u') |
|
| 1171 | - ->from(CmsUser::class, 'u') |
|
| 1172 | - ->where('u.id = ?0'); |
|
| 1170 | + ->select('u') |
|
| 1171 | + ->from(CmsUser::class, 'u') |
|
| 1172 | + ->where('u.id = ?0'); |
|
| 1173 | 1173 | |
| 1174 | 1174 | $builder->setParameter(0, 0); |
| 1175 | 1175 | |
@@ -1184,10 +1184,10 @@ discard block |
||
| 1184 | 1184 | public function testSetParameterWithNameZeroIsNotOverridden() : void |
| 1185 | 1185 | { |
| 1186 | 1186 | $builder = $this->_em->createQueryBuilder() |
| 1187 | - ->select('u') |
|
| 1188 | - ->from(CmsUser::class, 'u') |
|
| 1189 | - ->where('u.id != ?0') |
|
| 1190 | - ->andWhere('u.username = :name'); |
|
| 1187 | + ->select('u') |
|
| 1188 | + ->from(CmsUser::class, 'u') |
|
| 1189 | + ->where('u.id != ?0') |
|
| 1190 | + ->andWhere('u.username = :name'); |
|
| 1191 | 1191 | |
| 1192 | 1192 | $builder->setParameter(0, 0); |
| 1193 | 1193 | $builder->setParameter('name', 'Doctrine'); |
@@ -1203,10 +1203,10 @@ discard block |
||
| 1203 | 1203 | public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void |
| 1204 | 1204 | { |
| 1205 | 1205 | $builder = $this->_em->createQueryBuilder() |
| 1206 | - ->select('u') |
|
| 1207 | - ->from(CmsUser::class, 'u') |
|
| 1208 | - ->where('u.id != ?0') |
|
| 1209 | - ->andWhere('u.username = :name'); |
|
| 1206 | + ->select('u') |
|
| 1207 | + ->from(CmsUser::class, 'u') |
|
| 1208 | + ->where('u.id != ?0') |
|
| 1209 | + ->andWhere('u.username = :name'); |
|
| 1210 | 1210 | |
| 1211 | 1211 | $builder->setParameter('name', 'Doctrine'); |
| 1212 | 1212 | $builder->setParameter(0, 0); |
@@ -1222,10 +1222,10 @@ discard block |
||
| 1222 | 1222 | public function testSetParameterWithTypeJugglingWorks() : void |
| 1223 | 1223 | { |
| 1224 | 1224 | $builder = $this->_em->createQueryBuilder() |
| 1225 | - ->select('u') |
|
| 1226 | - ->from(CmsUser::class, 'u') |
|
| 1227 | - ->where('u.id != ?0') |
|
| 1228 | - ->andWhere('u.username = :name'); |
|
| 1225 | + ->select('u') |
|
| 1226 | + ->from(CmsUser::class, 'u') |
|
| 1227 | + ->where('u.id != ?0') |
|
| 1228 | + ->andWhere('u.username = :name'); |
|
| 1229 | 1229 | |
| 1230 | 1230 | $builder->setParameter('0', 1); |
| 1231 | 1231 | $builder->setParameter('name', 'Doctrine'); |
@@ -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\Tests\ORM\Tools; |
| 6 | 6 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->namespace = uniqid("doctrine_", false); |
| 54 | 54 | $this->tmpDir = sys_get_temp_dir(); |
| 55 | 55 | |
| 56 | - mkdir($this->tmpDir . \DIRECTORY_SEPARATOR . $this->namespace); |
|
| 56 | + mkdir($this->tmpDir.\DIRECTORY_SEPARATOR.$this->namespace); |
|
| 57 | 57 | |
| 58 | 58 | $this->generator = new EntityGenerator(); |
| 59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function tearDown() |
| 68 | 68 | { |
| 69 | - $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir . '/' . $this->namespace)); |
|
| 69 | + $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir.'/'.$this->namespace)); |
|
| 70 | 70 | |
| 71 | 71 | foreach ($ri AS $file) { |
| 72 | 72 | /* @var $file \SplFileInfo */ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - rmdir($this->tmpDir . '/' . $this->namespace); |
|
| 78 | + rmdir($this->tmpDir.'/'.$this->namespace); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function generateBookEntityFixture(array $embeddedClasses = []) |
| 87 | 87 | { |
| 88 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 88 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 89 | 89 | |
| 90 | - $metadata->setCustomRepositoryClassName($this->namespace . '\EntityGeneratorBookRepository'); |
|
| 90 | + $metadata->setCustomRepositoryClassName($this->namespace.'\EntityGeneratorBookRepository'); |
|
| 91 | 91 | |
| 92 | 92 | $tableMetadata = new Mapping\TableMetadata(); |
| 93 | 93 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | private function generateEntityTypeFixture(array $field) |
| 208 | 208 | { |
| 209 | - $metadata = new ClassMetadata($this->namespace . '\EntityType', $this->staticMetadataBuildingContext); |
|
| 209 | + $metadata = new ClassMetadata($this->namespace.'\EntityType', $this->staticMetadataBuildingContext); |
|
| 210 | 210 | |
| 211 | 211 | $tableMetadata = new Mapping\TableMetadata(); |
| 212 | 212 | $tableMetadata->setName('entity_type'); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null) |
| 241 | 241 | { |
| 242 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 242 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 243 | 243 | |
| 244 | 244 | $metadata->isEmbeddedClass = true; |
| 245 | 245 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | private function generateTestEmbeddableFixture() |
| 300 | 300 | { |
| 301 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 301 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 302 | 302 | |
| 303 | 303 | $metadata->isEmbeddedClass = true; |
| 304 | 304 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | private function loadEntityClass(ClassMetadata $metadata) |
| 342 | 342 | { |
| 343 | 343 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 344 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 344 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 345 | 345 | |
| 346 | 346 | self::assertFileExists($path); |
| 347 | 347 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 494 | 494 | |
| 495 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/EntityGeneratorBook.php~"); |
|
| 495 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/EntityGeneratorBook.php~"); |
|
| 496 | 496 | |
| 497 | 497 | $book = $this->newInstance($metadata); |
| 498 | 498 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | self::assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'getAuthor')); |
| 544 | 544 | self::assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'setAuthor')); |
| 545 | 545 | |
| 546 | - $expectedClassName = '\\' . $embeddedMetadata->getClassName(); |
|
| 546 | + $expectedClassName = '\\'.$embeddedMetadata->getClassName(); |
|
| 547 | 547 | |
| 548 | 548 | self::assertPhpDocVarType($expectedClassName, new \ReflectionProperty($book, 'isbn')); |
| 549 | 549 | self::assertPhpDocReturnType($expectedClassName, new \ReflectionMethod($book, 'getIsbn')); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | public function testMappedSuperclassAnnotationGeneration() |
| 649 | 649 | { |
| 650 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 650 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 651 | 651 | |
| 652 | 652 | $metadata->isMappedSuperclass = true; |
| 653 | 653 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | */ |
| 685 | 685 | public function testGenerateEntityWithSequenceGenerator() |
| 686 | 686 | { |
| 687 | - $metadata = new ClassMetadata($this->namespace . '\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 687 | + $metadata = new ClassMetadata($this->namespace.'\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 688 | 688 | $metadata->setTable(new Mapping\TableMetadata('ddc1784_entity')); |
| 689 | 689 | |
| 690 | 690 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
@@ -702,8 +702,8 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 704 | 704 | |
| 705 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 706 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php'; |
|
| 705 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 706 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php'; |
|
| 707 | 707 | |
| 708 | 708 | self::assertFileExists($filename); |
| 709 | 709 | |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | */ |
| 724 | 724 | public function testGenerateEntityWithMultipleInverseJoinColumns() |
| 725 | 725 | { |
| 726 | - $metadata = new ClassMetadata($this->namespace . '\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 726 | + $metadata = new ClassMetadata($this->namespace.'\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 727 | 727 | $metadata->setTable(new Mapping\TableMetadata('ddc2079_entity')); |
| 728 | 728 | |
| 729 | 729 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
@@ -763,14 +763,14 @@ discard block |
||
| 763 | 763 | $association = new Mapping\ManyToManyAssociationMetadata('centroCustos'); |
| 764 | 764 | |
| 765 | 765 | $association->setJoinTable($joinTable); |
| 766 | - $association->setTargetEntity($this->namespace . '\\DDC2079CentroCusto'); |
|
| 766 | + $association->setTargetEntity($this->namespace.'\\DDC2079CentroCusto'); |
|
| 767 | 767 | |
| 768 | 768 | $metadata->addProperty($association); |
| 769 | 769 | |
| 770 | 770 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 771 | 771 | |
| 772 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 773 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php'; |
|
| 772 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 773 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php'; |
|
| 774 | 774 | |
| 775 | 775 | self::assertFileExists($filename); |
| 776 | 776 | |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | $method->setAccessible(true); |
| 802 | 802 | |
| 803 | 803 | foreach ($constants as $name => $value) { |
| 804 | - if( ! preg_match($pattern, $name)) { |
|
| 804 | + if ( ! preg_match($pattern, $name)) { |
|
| 805 | 805 | continue; |
| 806 | 806 | } |
| 807 | 807 | |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $method->setAccessible(true); |
| 831 | 831 | |
| 832 | 832 | foreach ($constants as $name => $value) { |
| 833 | - if( ! preg_match($pattern, $name)) { |
|
| 833 | + if ( ! preg_match($pattern, $name)) { |
|
| 834 | 834 | continue; |
| 835 | 835 | } |
| 836 | 836 | |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | $method->setAccessible(true); |
| 860 | 860 | |
| 861 | 861 | foreach ($constants as $name => $value) { |
| 862 | - if( ! preg_match($pattern, $name)) { |
|
| 862 | + if ( ! preg_match($pattern, $name)) { |
|
| 863 | 863 | continue; |
| 864 | 864 | } |
| 865 | 865 | |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | public function testEntityTypeAlias(array $field) |
| 884 | 884 | { |
| 885 | 885 | $metadata = $this->generateEntityTypeFixture($field); |
| 886 | - $path = $this->tmpDir . '/'. $this->namespace . '/EntityType.php'; |
|
| 886 | + $path = $this->tmpDir.'/'.$this->namespace.'/EntityType.php'; |
|
| 887 | 887 | |
| 888 | 888 | self::assertFileExists($path); |
| 889 | 889 | require_once $path; |
@@ -896,8 +896,8 @@ discard block |
||
| 896 | 896 | $type = $field['phpType']; |
| 897 | 897 | $name = $field['fieldName']; |
| 898 | 898 | $value = $field['value']; |
| 899 | - $getter = "get" . ucfirst($name); |
|
| 900 | - $setter = "set" . ucfirst($name); |
|
| 899 | + $getter = "get".ucfirst($name); |
|
| 900 | + $setter = "set".ucfirst($name); |
|
| 901 | 901 | |
| 902 | 902 | self::assertPhpDocVarType($type, $reflClass->getProperty($name)); |
| 903 | 903 | self::assertPhpDocParamType($type, $reflClass->getMethod($setter)); |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 921 | 921 | |
| 922 | 922 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 923 | - $metadata->setClassName($this->namespace . "\DDC2372User"); |
|
| 923 | + $metadata->setClassName($this->namespace."\DDC2372User"); |
|
| 924 | 924 | |
| 925 | 925 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 926 | 926 | |
| 927 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"); |
|
| 927 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372User.php"); |
|
| 928 | 928 | |
| 929 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"; |
|
| 929 | + require $this->tmpDir."/".$this->namespace."/DDC2372User.php"; |
|
| 930 | 930 | |
| 931 | 931 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 932 | 932 | |
@@ -948,12 +948,12 @@ discard block |
||
| 948 | 948 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 949 | 949 | |
| 950 | 950 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 951 | - $metadata->setClassName($this->namespace . "\DDC2372Admin"); |
|
| 951 | + $metadata->setClassName($this->namespace."\DDC2372Admin"); |
|
| 952 | 952 | |
| 953 | 953 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 954 | 954 | |
| 955 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"); |
|
| 956 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"; |
|
| 955 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372Admin.php"); |
|
| 956 | + require $this->tmpDir."/".$this->namespace."/DDC2372Admin.php"; |
|
| 957 | 957 | |
| 958 | 958 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 959 | 959 | |
@@ -973,22 +973,22 @@ discard block |
||
| 973 | 973 | $cmf->setEntityManager($em); |
| 974 | 974 | |
| 975 | 975 | $ns = $this->namespace; |
| 976 | - $nsdir = $this->tmpDir . '/' . $ns; |
|
| 976 | + $nsdir = $this->tmpDir.'/'.$ns; |
|
| 977 | 977 | |
| 978 | 978 | // Dump DDC1590User into temp file |
| 979 | 979 | $content = str_replace( |
| 980 | 980 | 'namespace Doctrine\Tests\Models\DDC1590', |
| 981 | - 'namespace ' . $ns, |
|
| 982 | - file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php') |
|
| 981 | + 'namespace '.$ns, |
|
| 982 | + file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php') |
|
| 983 | 983 | ); |
| 984 | 984 | |
| 985 | - $fname = $nsdir . "/DDC1590User.php"; |
|
| 985 | + $fname = $nsdir."/DDC1590User.php"; |
|
| 986 | 986 | file_put_contents($fname, $content); |
| 987 | 987 | |
| 988 | 988 | // Require DDC1590User |
| 989 | 989 | require $fname; |
| 990 | 990 | |
| 991 | - $metadata = $cmf->getMetadataFor($ns . '\DDC1590User'); |
|
| 991 | + $metadata = $cmf->getMetadataFor($ns.'\DDC1590User'); |
|
| 992 | 992 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 993 | 993 | |
| 994 | 994 | // class DDC1590User extends DDC1590Entity { ... } |
@@ -996,13 +996,13 @@ discard block |
||
| 996 | 996 | |
| 997 | 997 | // class _DDC1590User extends DDC1590Entity { ... } |
| 998 | 998 | $source2 = str_replace('class DDC1590User', 'class _DDC1590User', $source); |
| 999 | - $fname2 = $nsdir . "/_DDC1590User.php"; |
|
| 999 | + $fname2 = $nsdir."/_DDC1590User.php"; |
|
| 1000 | 1000 | file_put_contents($fname2, $source2); |
| 1001 | 1001 | require $fname2; |
| 1002 | 1002 | |
| 1003 | 1003 | // class __DDC1590User { ... } |
| 1004 | 1004 | $source3 = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source); |
| 1005 | - $fname3 = $nsdir . "/__DDC1590User.php"; |
|
| 1005 | + $fname3 = $nsdir."/__DDC1590User.php"; |
|
| 1006 | 1006 | file_put_contents($fname3, $source3); |
| 1007 | 1007 | require $fname3; |
| 1008 | 1008 | |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | $this->loadEntityClass($metadata); |
| 1166 | 1166 | |
| 1167 | 1167 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 1168 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 1168 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 1169 | 1169 | $classTest = file_get_contents($path); |
| 1170 | 1170 | |
| 1171 | 1171 | $this->generator->setRegenerateEntityIfExists(true); |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 1175 | 1175 | $classNew = file_get_contents($path); |
| 1176 | 1176 | |
| 1177 | - self::assertSame($classTest,$classNew); |
|
| 1177 | + self::assertSame($classTest, $classNew); |
|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | /** |
@@ -1361,14 +1361,14 @@ discard block |
||
| 1361 | 1361 | */ |
| 1362 | 1362 | public function testOptionsAreGeneratedProperly(string $expectedAnnotation, array $fieldConfiguration) : void |
| 1363 | 1363 | { |
| 1364 | - $metadata = new ClassMetadataInfo($this->_namespace . '\GH6703Options'); |
|
| 1364 | + $metadata = new ClassMetadataInfo($this->_namespace.'\GH6703Options'); |
|
| 1365 | 1365 | $metadata->namespace = $this->_namespace; |
| 1366 | 1366 | $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]); |
| 1367 | 1367 | $metadata->mapField(['fieldName' => 'test'] + $fieldConfiguration); |
| 1368 | 1368 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
| 1369 | 1369 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 1370 | 1370 | |
| 1371 | - $filename = $this->_tmpDir . DIRECTORY_SEPARATOR . $this->_namespace . DIRECTORY_SEPARATOR . 'GH6703Options.php'; |
|
| 1371 | + $filename = $this->_tmpDir.DIRECTORY_SEPARATOR.$this->_namespace.DIRECTORY_SEPARATOR.'GH6703Options.php'; |
|
| 1372 | 1372 | |
| 1373 | 1373 | self::assertFileExists($filename); |
| 1374 | 1374 | require_once $filename; |
@@ -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\Tests\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ['decorated' => false] |
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | - self::assertEquals('Clearing all second-level cache collection regions' . PHP_EOL, $tester->getDisplay()); |
|
| 55 | + self::assertEquals('Clearing all second-level cache collection regions'.PHP_EOL, $tester->getDisplay()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function testClearByOwnerEntityClassName() |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | ['decorated' => false] |
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | - self::assertEquals('Clearing second-level cache for collection "Doctrine\Tests\Models\Cache\State#cities"' . PHP_EOL, $tester->getDisplay()); |
|
| 72 | + self::assertEquals('Clearing second-level cache for collection "Doctrine\Tests\Models\Cache\State#cities"'.PHP_EOL, $tester->getDisplay()); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function testClearCacheEntryName() |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ['decorated' => false] |
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | - self::assertEquals('Clearing second-level cache entry for collection "Doctrine\Tests\Models\Cache\State#cities" owner entity identified by "1"' . PHP_EOL, $tester->getDisplay()); |
|
| 90 | + self::assertEquals('Clearing second-level cache entry for collection "Doctrine\Tests\Models\Cache\State#cities" owner entity identified by "1"'.PHP_EOL, $tester->getDisplay()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function testFlushRegionName() |
@@ -105,6 +105,6 @@ discard block |
||
| 105 | 105 | ['decorated' => false] |
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | - self::assertEquals('Flushing cache provider configured for "Doctrine\Tests\Models\Cache\State#cities"' . PHP_EOL, $tester->getDisplay()); |
|
| 108 | + self::assertEquals('Flushing cache provider configured for "Doctrine\Tests\Models\Cache\State#cities"'.PHP_EOL, $tester->getDisplay()); |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -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\Mapping\Driver; |
| 6 | 6 | |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | if (isset($manyToOneElement['fetch'])) { |
| 479 | 479 | $association->setFetchMode( |
| 480 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 480 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 481 | 481 | ); |
| 482 | 482 | } |
| 483 | 483 | |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | $fieldName = (string) $overrideElement['name']; |
| 630 | 630 | $property = $metadata->getProperty($fieldName); |
| 631 | 631 | |
| 632 | - if (! $property) { |
|
| 632 | + if ( ! $property) { |
|
| 633 | 633 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 634 | 634 | } |
| 635 | 635 | |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | // Check for fetch |
| 688 | 688 | if (isset($overrideElement['fetch'])) { |
| 689 | 689 | $override->setFetchMode( |
| 690 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 690 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | 693 | |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | // Evaluate <lifecycle-callbacks...> |
| 699 | 699 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 700 | 700 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 701 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 701 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 702 | 702 | $methodName = (string) $lifecycleCallback['method']; |
| 703 | 703 | |
| 704 | 704 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 711 | 711 | $listenerClassName = $metadata->fullyQualifiedClassName((string) $listenerElement['class']); |
| 712 | 712 | |
| 713 | - if (! class_exists($listenerClassName)) { |
|
| 713 | + if ( ! class_exists($listenerClassName)) { |
|
| 714 | 714 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 715 | 715 | $listenerClassName, |
| 716 | 716 | $metadata->getClassName() |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | ) |
| 886 | 886 | { |
| 887 | 887 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 888 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 888 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 889 | 889 | |
| 890 | 890 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
| 891 | 891 | $usage = isset($cacheMapping['usage']) |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | Events::preFlush, |
| 917 | 917 | ]; |
| 918 | 918 | |
| 919 | - return array_filter($events, function ($eventName) use ($method) { |
|
| 919 | + return array_filter($events, function($eventName) use ($method) { |
|
| 920 | 920 | return $eventName === $method->getName(); |
| 921 | 921 | }); |
| 922 | 922 | } |