Skip to content

Commit 6ad1fbc

Browse files
committed
Fix phpstan
1 parent 70289ca commit 6ad1fbc

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ parameters:
3030
- src/Bridge/Symfony/Bundle/Test/BrowserKitAssertionsTrait.php
3131
- tests/Bridge/Symfony/Bundle/Test/WebTestCaseTest.php
3232
- tests/ProphecyTrait.php
33+
- tests/Behat/CoverageContext.php
3334
earlyTerminatingMethodCalls:
3435
PHPUnit\Framework\Constraint\Constraint:
3536
- fail

src/Bridge/Doctrine/MongoDbOdm/CollectionDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
2020
use ApiPlatform\Core\Exception\RuntimeException;
2121
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
22-
use Doctrine\Common\Persistence\ManagerRegistry;
2322
use Doctrine\ODM\MongoDB\DocumentManager;
2423
use Doctrine\ODM\MongoDB\Repository\DocumentRepository;
24+
use Doctrine\Persistence\ManagerRegistry;
2525

2626
/**
2727
* Collection data provider for the Doctrine MongoDB ODM.

src/Bridge/Doctrine/MongoDbOdm/Extension/PaginationExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
use ApiPlatform\Core\DataProvider\Pagination;
1818
use ApiPlatform\Core\Exception\RuntimeException;
1919
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
20-
use Doctrine\Common\Persistence\ManagerRegistry;
2120
use Doctrine\ODM\MongoDB\Aggregation\Builder;
2221
use Doctrine\ODM\MongoDB\DocumentManager;
2322
use Doctrine\ODM\MongoDB\Repository\DocumentRepository;
23+
use Doctrine\Persistence\ManagerRegistry;
2424

2525
/**
2626
* Applies pagination on the Doctrine aggregation for resource collection when enabled.

src/Bridge/Doctrine/MongoDbOdm/ItemDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2424
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2525
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
26-
use Doctrine\Common\Persistence\ManagerRegistry;
2726
use Doctrine\ODM\MongoDB\DocumentManager;
2827
use Doctrine\ODM\MongoDB\Repository\DocumentRepository;
28+
use Doctrine\Persistence\ManagerRegistry;
2929

3030
/**
3131
* Item data provider for the Doctrine MongoDB ODM.

src/Bridge/Doctrine/MongoDbOdm/SubresourceDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2626
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2727
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
28-
use Doctrine\Common\Persistence\ManagerRegistry;
2928
use Doctrine\ODM\MongoDB\Aggregation\Builder;
3029
use Doctrine\ODM\MongoDB\DocumentManager;
3130
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
3231
use Doctrine\ODM\MongoDB\Repository\DocumentRepository;
32+
use Doctrine\Persistence\ManagerRegistry;
3333

3434
/**
3535
* Subresource data provider for the Doctrine MongoDB ODM.

tests/Behat/CoverageContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public static function setup()
4747
return;
4848
}
4949

50-
$filter->addDirectoryToWhitelist(__DIR__.'/../../src'); // @phpstan-ignore-line
51-
self::$coverage = new CodeCoverage(null, $filter); // @phpstan-ignore-line
50+
$filter->addDirectoryToWhitelist(__DIR__.'/../../src');
51+
self::$coverage = new CodeCoverage(null, $filter);
5252
}
5353

5454
/**

tests/Bridge/Doctrine/MongoDbOdm/ItemDataProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testGetItemWithExecuteOptions()
9696
{
9797
$context = ['foo' => 'bar', 'fetch_data' => true, IdentifierConverterInterface::HAS_IDENTIFIER_CONVERTER => true];
9898

99-
$matchProphecy = $this->prophesize(Match::class);
99+
$matchProphecy = $this->prophesize(AggregationMatch::class);
100100
$matchProphecy->field('id')->willReturn($matchProphecy)->shouldBeCalled();
101101
$matchProphecy->equals(1)->shouldBeCalled();
102102

tests/Bridge/Doctrine/MongoDbOdm/SubresourceDataProviderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function testGetSubSubresourceItemWithExecuteOptions()
272272
$dummyLookup->alias('relatedDummies')->shouldBeCalled();
273273
$dummyAggregationBuilder->lookup('relatedDummies')->shouldBeCalled()->willReturn($dummyLookup->reveal());
274274

275-
$dummyMatch = $this->prophesize(Match::class);
275+
$dummyMatch = $this->prophesize(AggregationMatch::class);
276276
$dummyMatch->equals(1)->shouldBeCalled();
277277
$dummyMatch->field('id')->shouldBeCalled()->willReturn($dummyMatch);
278278
$dummyAggregationBuilder->match()->shouldBeCalled()->willReturn($dummyMatch->reveal());
@@ -296,10 +296,10 @@ public function testGetSubSubresourceItemWithExecuteOptions()
296296
$rLookup->alias('thirdLevel')->shouldBeCalled();
297297
$rAggregationBuilder->lookup('thirdLevel')->shouldBeCalled()->willReturn($rLookup->reveal());
298298

299-
$rMatch = $this->prophesize(Match::class);
299+
$rMatch = $this->prophesize(AggregationMatch::class);
300300
$rMatch->equals(1)->shouldBeCalled();
301301
$rMatch->field('id')->shouldBeCalled()->willReturn($rMatch);
302-
$previousRMatch = $this->prophesize(Match::class);
302+
$previousRMatch = $this->prophesize(AggregationMatch::class);
303303
$previousRMatch->in([2])->shouldBeCalled();
304304
$previousRMatch->field('_id')->shouldBeCalled()->willReturn($previousRMatch);
305305
$rAggregationBuilder->match()->shouldBeCalled()->willReturn($rMatch->reveal(), $previousRMatch->reveal());
@@ -321,7 +321,7 @@ public function testGetSubSubresourceItemWithExecuteOptions()
321321
// Origin manager (ThirdLevel)
322322
$aggregationBuilder = $this->prophesize(Builder::class);
323323

324-
$match = $this->prophesize(Match::class);
324+
$match = $this->prophesize(AggregationMatch::class);
325325
$match->in([3])->shouldBeCalled();
326326
$match->field('_id')->shouldBeCalled()->willReturn($match);
327327
$aggregationBuilder->match()->shouldBeCalled()->willReturn($match);

0 commit comments

Comments
 (0)