Skip to content

Commit 1203621

Browse files
committed
Fix CS
1 parent 7d1615a commit 1203621

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.php_cs.dist

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ return PhpCsFixer\Config::create()
4343
'throw',
4444
'use',
4545
],
46-
'no_unreachable_default_argument_value' => true,
4746
'no_useless_else' => true,
4847
'no_useless_return' => true,
4948
'ordered_imports' => true,

src/Util/AnnotationFilterExtractorTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ trait AnnotationFilterExtractorTrait
3636
private function getFilterAnnotations(array $miscAnnotations): \Iterator
3737
{
3838
foreach ($miscAnnotations as $miscAnnotation) {
39-
if (get_class($miscAnnotation) === ApiFilter::class) {
39+
if (ApiFilter::class === get_class($miscAnnotation)) {
4040
yield $miscAnnotation;
4141
}
4242
}

tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPassTest.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\AnnotationFilterPass;
2222
use ApiPlatform\Core\Serializer\Filter\GroupFilter;
2323
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Doctrine\Orm\Filter\AnotherDummyFilter;
24+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy;
2425
use Doctrine\Common\Annotations\Reader;
2526
use Prophecy\Argument;
2627
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -47,15 +48,15 @@ public function testProcess()
4748
$reader = $this->prophesize(Reader::class);
4849

4950
$reader->getPropertyAnnotations(Argument::type(\ReflectionProperty::class))->will(function ($args) {
50-
if ($args[0]->class === 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy' && $args[0]->name === 'dummyDate') {
51+
if (Dummy::class === $args[0]->class && 'dummyDate' === $args[0]->name) {
5152
return [new ApiFilter(['value' => DateFilter::class]), new ApiProperty()];
5253
}
5354

5455
return [];
5556
});
5657

5758
$reader->getClassAnnotations(Argument::type(\ReflectionClass::class))->will(function ($args) {
58-
if ($args[0]->name === 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy') {
59+
if (Dummy::class === $args[0]->name) {
5960
return [new ApiFilter(['value' => SearchFilter::class, 'strategy' => 'exact', 'properties' => ['description', 'relatedDummy.name', 'name']]), new ApiResource(), new ApiFilter(['value' => GroupFilter::class, 'arguments' => ['parameterName' => 'foobar']])];
6061
}
6162

@@ -118,7 +119,7 @@ public function testProcessWrongFilter()
118119
});
119120

120121
$reader->getClassAnnotations(Argument::type(\ReflectionClass::class))->will(function ($args) {
121-
if ($args[0]->name === 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy') {
122+
if (Dummy::class === $args[0]->name) {
122123
return [new ApiFilter(['value' => AnotherDummyFilter::class])];
123124
}
124125

@@ -149,7 +150,7 @@ public function testProcessExistingFilter()
149150
});
150151

151152
$reader->getClassAnnotations(Argument::type(\ReflectionClass::class))->will(function ($args) {
152-
if ($args[0]->name === 'ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy') {
153+
if (Dummy::class === $args[0]->name) {
153154
return [new ApiFilter(['value' => SearchFilter::class])];
154155
}
155156

0 commit comments

Comments
 (0)