Skip to content

Commit 5f4137b

Browse files
committed
Fix CS issues
1 parent 3efdbe0 commit 5f4137b

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/Persisters/Collection/ManyToManyPersister.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
use Doctrine\ORM\PersistentCollection;
1414
use Doctrine\ORM\Persisters\SqlValueVisitor;
1515
use Doctrine\ORM\Query;
16-
use Doctrine\ORM\Query\ParameterTypeInferer;
1716
use Doctrine\ORM\Utility\PersisterHelper;
1817

1918
use function array_fill;
19+
use function array_merge;
2020
use function array_pop;
2121
use function count;
2222
use function get_class;
@@ -265,6 +265,7 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri
265265
} else {
266266
$whereClauses[] = sprintf('te.%s %s ?', $field, $operator);
267267
}
268+
268269
$params = array_merge($params, PersisterHelper::convertToParameterValue($value, $this->em));
269270
$paramTypes = array_merge($paramTypes, PersisterHelper::inferParameterTypes($name, $value, $targetClass, $this->em));
270271
}

src/Persisters/Entity/BasicEntityPersister.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Doctrine\ORM\Persisters\Entity;
66

7-
use BackedEnum;
87
use Doctrine\Common\Collections\Criteria;
98
use Doctrine\Common\Collections\Expr\Comparison;
109
use Doctrine\DBAL\Connection;
@@ -26,9 +25,7 @@
2625
use Doctrine\ORM\Persisters\Exception\UnrecognizedField;
2726
use Doctrine\ORM\Persisters\SqlExpressionVisitor;
2827
use Doctrine\ORM\Persisters\SqlValueVisitor;
29-
use Doctrine\ORM\Proxy\DefaultProxyClassNameResolver;
3028
use Doctrine\ORM\Query;
31-
use Doctrine\ORM\Query\QueryException;
3229
use Doctrine\ORM\Repository\Exception\InvalidFindByCall;
3330
use Doctrine\ORM\UnitOfWork;
3431
use Doctrine\ORM\Utility\IdentifierFlattener;
@@ -47,7 +44,6 @@
4744
use function count;
4845
use function implode;
4946
use function is_array;
50-
use function is_object;
5147
use function reset;
5248
use function spl_object_id;
5349
use function sprintf;

src/Utility/PersisterHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
use Doctrine\ORM\Query\QueryException;
1414
use RuntimeException;
1515

16+
use function array_map;
17+
use function array_merge;
18+
use function is_array;
19+
use function is_object;
1620
use function sprintf;
1721

1822
/**
@@ -151,7 +155,7 @@ public static function inferParameterTypes(string $field, $value, ClassMetadata
151155
: $assoc['sourceToTargetKeyColumns'];
152156

153157
foreach ($columns as $column) {
154-
$types[] = PersisterHelper::getTypeOfColumn($column, $class, $em);
158+
$types[] = self::getTypeOfColumn($column, $class, $em);
155159
}
156160

157161
break;

tests/Tests/Models/Enums/BookCategory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;
9-
use Doctrine\Common\Collections\Criteria;
109
use Doctrine\ORM\Mapping\Column;
1110
use Doctrine\ORM\Mapping\Entity;
1211
use Doctrine\ORM\Mapping\GeneratedValue;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Doctrine\Tests\Models\Enums;
46

57
enum BookGenre: string
68
{
7-
case FICTION = 'fiction';
9+
case FICTION = 'fiction';
810
case NON_FICTION = 'non fiction';
911
}

tests/Tests/Models/Enums/BookWithGenre.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
use Doctrine\ORM\Mapping\Entity;
1111
use Doctrine\ORM\Mapping\GeneratedValue;
1212
use Doctrine\ORM\Mapping\Id;
13-
use Doctrine\ORM\Mapping\JoinColumn;
1413
use Doctrine\ORM\Mapping\ManyToMany;
1514
use Doctrine\ORM\Mapping\ManyToOne;
16-
use Doctrine\ORM\Mapping\Table;
1715

1816
#[Entity]
1917
class BookWithGenre
@@ -34,7 +32,7 @@ class BookWithGenre
3432

3533
public function __construct(BookGenre $genre)
3634
{
37-
$this->genre = $genre;
35+
$this->genre = $genre;
3836
$this->categories = new ArrayCollection();
3937
}
4038
}

tests/Tests/Models/Enums/Library.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;
9-
use Doctrine\Common\Collections\Criteria;
109
use Doctrine\ORM\Mapping\Column;
1110
use Doctrine\ORM\Mapping\Entity;
1211
use Doctrine\ORM\Mapping\GeneratedValue;

tests/Tests/ORM/Functional/EnumTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use Doctrine\ORM\Tools\SchemaTool;
1515
use Doctrine\Tests\Models\DataTransferObjects\DtoWithArrayOfEnums;
1616
use Doctrine\Tests\Models\DataTransferObjects\DtoWithEnum;
17-
use Doctrine\Tests\Models\Enums\BookWithGenre;
1817
use Doctrine\Tests\Models\Enums\BookCategory;
1918
use Doctrine\Tests\Models\Enums\BookGenre;
19+
use Doctrine\Tests\Models\Enums\BookWithGenre;
2020
use Doctrine\Tests\Models\Enums\Card;
2121
use Doctrine\Tests\Models\Enums\CardWithDefault;
2222
use Doctrine\Tests\Models\Enums\CardWithNullable;
@@ -28,6 +28,7 @@
2828
use Doctrine\Tests\Models\Enums\TypedCard;
2929
use Doctrine\Tests\Models\Enums\Unit;
3030
use Doctrine\Tests\OrmFunctionalTestCase;
31+
use Generator;
3132

3233
use function dirname;
3334
use function sprintf;
@@ -540,10 +541,10 @@ public function testEnumCollectionMatchingOnOneToMany(Comparison $comparison): v
540541

541542
$library = new Library();
542543

543-
$fictionBook = new BookWithGenre(BookGenre::FICTION);
544+
$fictionBook = new BookWithGenre(BookGenre::FICTION);
544545
$fictionBook->library = $library;
545546

546-
$nonfictionBook = new BookWithGenre(BookGenre::NON_FICTION);
547+
$nonfictionBook = new BookWithGenre(BookGenre::NON_FICTION);
547548
$nonfictionBook->library = $library;
548549

549550
$this->_em->persist($library);
@@ -593,7 +594,7 @@ public function testEnumCollectionMatchingOnManyToMany(Comparison $comparison):
593594
self::assertSame($nonfictionBook->id, $result[0]->id);
594595
}
595596

596-
public function provideGenreMatchingExpressions(): \Generator
597+
public function provideGenreMatchingExpressions(): Generator
597598
{
598599
yield [Criteria::expr()->eq('genre', BookGenre::NON_FICTION)];
599600
yield [Criteria::expr()->in('genre', [BookGenre::NON_FICTION])];

tests/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ public function testMatchingWithInCondition(): void
589589
self::assertFalse($user->groups->isInitialized(), 'Pre-condition: lazy collection');
590590

591591
$criteria = Criteria::create()->where(Criteria::expr()->in('name', ['Developers_1']));
592-
$result = $groups->matching($criteria);
592+
$result = $groups->matching($criteria);
593593

594594
self::assertCount(1, $result);
595595
self::assertEquals('Developers_1', $result[0]->name);

0 commit comments

Comments
 (0)