Skip to content

Commit 4ec0e7b

Browse files
committed
Fix phpstan types
1 parent 952ba56 commit 4ec0e7b

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

phpstan.baseline-generated-files.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ parameters:
1111
count: 1
1212
path: src/DependencyInjection/ThumbnailService.php
1313
reportUnmatched: false
14+
15+
-
16+
message: '#^Call to deprecated method#'
17+
count: 3
18+
path: src/DependencyInjection/ThumbnailService.php
19+
reportUnmatched: false
20+
1421
-
1522
message: "#^Call to an undefined method Shopware\\\\Core\\\\Content\\\\Media\\\\Message\\\\GenerateThumbnailsMessage\\:\\:setContext\\(\\)\\.$#"
1623
count: 1

tests/integration/MediaUrlTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Shopware\Core\Content\Media\Commands\GenerateThumbnailsCommand;
99
use Shopware\Core\Content\Media\Core\Application\AbstractMediaUrlGenerator;
1010
use Shopware\Core\Content\Media\MediaCollection;
11+
use Shopware\Core\Content\Media\MediaEntity;
1112
use Shopware\Core\Content\Test\Media\MediaFixtures;
1213
use Shopware\Core\Framework\Context;
1314
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
@@ -93,6 +94,7 @@ public function testMediaUrlWithInactiveConfigResultsInOriginalMedia(): void
9394
$mediaResult = $this->mediaRepository->search($searchCriteria, $this->context);
9495

9596
$updatedMedia = $mediaResult->getEntities()->first();
97+
static::assertInstanceOf(MediaEntity::class, $updatedMedia);
9698

9799
$thumbnails = $updatedMedia->getThumbnails();
98100
static::assertInstanceOf(MediaThumbnailCollection::class, $thumbnails);
@@ -152,6 +154,7 @@ public function testMediaUrlWithActiveConfig(): void
152154
$mediaResult = $this->mediaRepository->search($searchCriteria, $this->context);
153155

154156
$updatedMedia = $mediaResult->getEntities()->first();
157+
static::assertInstanceOf(MediaEntity::class, $updatedMedia);
155158

156159
$thumbnails = $updatedMedia->getThumbnails();
157160
static::assertInstanceOf(MediaThumbnailCollection::class, $thumbnails);

tests/unit/EventListener/ThumbnailSizesChangedListenerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function testOnThumbnailSizeChanged(): void
4848
$mediaFolderCollection = new MediaFolderCollection();
4949
$mediaFolderCollection->add($mediaFolderEntity);
5050

51+
/** @var StaticEntityRepository<MediaFolderCollection> */
5152
$mediaFolderRepository = new StaticEntityRepository([$mediaFolderCollection]);
5253

5354
$thumbnailSizesChangedListener = new ThumbnailSizesChangedListener(

tests/unit/Service/SalesChannelIdDetectorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Frosh\ThumbnailProcessor\Tests\Unit\Service;
44

55
use Frosh\ThumbnailProcessor\Service\SalesChannelIdDetector;
6+
use PHPUnit\Framework\MockObject\MockObject;
67
use PHPUnit\Framework\TestCase;
78
use Shopware\Core\Content\ProductExport\ProductExportCollection;
89
use Shopware\Core\Content\ProductExport\ProductExportEntity;
@@ -90,6 +91,7 @@ public function testGetSalesChannelIdProductExport(): void
9091
$productExportCollection = new ProductExportCollection();
9192
$productExportCollection->add($productExportEntity);
9293

94+
/** @var StaticEntityRepository<ProductExportCollection> */
9395
$productExportRepository = new StaticEntityRepository([$productExportCollection]);
9496

9597
$class = new SalesChannelIdDetector($requestStack, $productExportRepository);
@@ -106,6 +108,7 @@ public function testGetSalesChannelIdProductExportWithoutFileNameAndAccessKey():
106108
],
107109
));
108110

111+
/** @var StaticEntityRepository<ProductExportCollection>&MockObject */
109112
$productExportRepository = $this->createMock(StaticEntityRepository::class);
110113
$productExportRepository->expects(static::never())->method('search');
111114

0 commit comments

Comments
 (0)