diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 211af313..976e860e 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -85,11 +85,6 @@ parameters: count: 1 path: src/bundle/DependencyInjection/ConfigurationMapper.php - - - message: "#^Parameter \\#1 \\$configuration of method Symfony\\\\Component\\\\DependencyInjection\\\\Extension\\\\Extension\\:\\:processConfiguration\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\ConfigurationInterface, Symfony\\\\Component\\\\Config\\\\Definition\\\\ConfigurationInterface\\|null given\\.$#" - count: 1 - path: src/bundle/DependencyInjection/EzRecommendationClientExtension.php - - message: "#^Method EzSystems\\\\EzRecommendationClientBundle\\\\EzRecommendationClientBundle\\:\\:build\\(\\) has no return type specified\\.$#" count: 1 @@ -1235,6 +1230,11 @@ parameters: count: 1 path: tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php + - + message: "#^PHPDoc tag @var for property EzSystems\\\\EzRecommendationClient\\\\Tests\\\\Event\\\\Subscriber\\\\AbstractCoreEventSubscriberTest\\:\\:\\$notificationServiceMock contains unresolvable type\\.$#" + count: 1 + path: tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php + - message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#" count: 1 @@ -1320,11 +1320,6 @@ parameters: count: 1 path: tests/lib/Event/Subscriber/ContentEventSubscriberTest.php - - - message: "#^Parameter \\#1 \\$notificationService of class EzSystems\\\\EzRecommendationClient\\\\Event\\\\Subscriber\\\\ContentEventSubscriber constructor expects EzSystems\\\\EzRecommendationClient\\\\Service\\\\NotificationService, EzSystems\\\\EzRecommendationClient\\\\Service\\\\EventNotificationService\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" - count: 1 - path: tests/lib/Event/Subscriber/ContentEventSubscriberTest.php - - message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#" count: 6 @@ -1332,7 +1327,12 @@ parameters: - message: "#^Call to an undefined method EzSystems\\\\EzRecommendationClient\\\\Helper\\\\ContentHelper\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\:\\:expects\\(\\)\\.$#" - count: 4 + count: 3 + path: tests/lib/Event/Subscriber/LocationEventSubscriberTest.php + + - + message: "#^Call to an undefined method EzSystems\\\\EzRecommendationClient\\\\Helper\\\\ContentHelper\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\:\\:method\\(\\)\\.$#" + count: 3 path: tests/lib/Event/Subscriber/LocationEventSubscriberTest.php - @@ -1385,16 +1385,6 @@ parameters: count: 1 path: tests/lib/Event/Subscriber/LocationEventSubscriberTest.php - - - message: "#^Method EzSystems\\\\EzRecommendationClient\\\\Tests\\\\Event\\\\Subscriber\\\\LocationEventSubscriberTest\\:\\:updateLocationWithChildrenDataProvider\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: tests/lib/Event/Subscriber/LocationEventSubscriberTest.php - - - - message: "#^Parameter \\#1 \\$notificationService of class EzSystems\\\\EzRecommendationClient\\\\Event\\\\Subscriber\\\\LocationEventSubscriber constructor expects EzSystems\\\\EzRecommendationClient\\\\Service\\\\NotificationService, EzSystems\\\\EzRecommendationClient\\\\Service\\\\EventNotificationService\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" - count: 1 - path: tests/lib/Event/Subscriber/LocationEventSubscriberTest.php - - message: "#^Parameter \\#1 \\$originalClassName of method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) expects class\\-string\\, string given\\.$#" count: 1 @@ -1435,21 +1425,11 @@ parameters: count: 1 path: tests/lib/Event/Subscriber/ObjectStateEventSubscriberTest.php - - - message: "#^Parameter \\#1 \\$notificationService of class EzSystems\\\\EzRecommendationClient\\\\Event\\\\Subscriber\\\\ObjectStateEventSubscriber constructor expects EzSystems\\\\EzRecommendationClient\\\\Service\\\\NotificationService, EzSystems\\\\EzRecommendationClient\\\\Service\\\\EventNotificationService\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" - count: 1 - path: tests/lib/Event/Subscriber/ObjectStateEventSubscriberTest.php - - message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#" count: 1 path: tests/lib/Event/Subscriber/ObjectStateEventSubscriberTest.php - - - message: "#^Anonymous function has an unused use \\$contentInfo\\.$#" - count: 2 - path: tests/lib/Event/Subscriber/TrashEventSubscriberTest.php - - message: "#^Method EzSystems\\\\EzRecommendationClient\\\\Tests\\\\Event\\\\Subscriber\\\\TrashEventSubscriberTest\\:\\:getRelationList\\(\\) has no return type specified\\.$#" count: 1 @@ -1480,11 +1460,6 @@ parameters: count: 1 path: tests/lib/Event/Subscriber/TrashEventSubscriberTest.php - - - message: "#^Parameter \\#1 \\$notificationService of class EzSystems\\\\EzRecommendationClient\\\\Event\\\\Subscriber\\\\TrashEventSubscriber constructor expects EzSystems\\\\EzRecommendationClient\\\\Service\\\\NotificationService, EzSystems\\\\EzRecommendationClient\\\\Service\\\\EventNotificationService\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" - count: 1 - path: tests/lib/Event/Subscriber/TrashEventSubscriberTest.php - - message: "#^Parameter \\#4 \\$locationHelper of class EzSystems\\\\EzRecommendationClient\\\\Event\\\\Subscriber\\\\TrashEventSubscriber constructor expects EzSystems\\\\EzRecommendationClient\\\\Helper\\\\LocationHelper, EzSystems\\\\EzRecommendationClient\\\\Helper\\\\LocationHelper\\|PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" count: 1 diff --git a/tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php b/tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php index d79cb510..4decc705 100644 --- a/tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php +++ b/tests/lib/Event/Subscriber/AbstractCoreEventSubscriberTest.php @@ -12,6 +12,7 @@ use eZ\Publish\Core\Repository\Values\Content\Content; use eZ\Publish\Core\Repository\Values\Content\Location; use eZ\Publish\Core\Repository\Values\Content\VersionInfo; +use EzSystems\EzRecommendationClient\Service\EventNotificationService; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -26,6 +27,9 @@ abstract class AbstractCoreEventSubscriberTest extends TestCase /** @var \eZ\Publish\Core\Repository\Values\Content\Content */ protected $content; + /** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Service\EventNotificationService */ + protected $notificationServiceMock; + public function setUp(): void { $this->contentInfo = new ContentInfo([ @@ -42,6 +46,7 @@ public function setUp(): void 'contentInfo' => $this->contentInfo, ]), ]); + $this->notificationServiceMock = $this->createMock(EventNotificationService::class); } /** diff --git a/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php b/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php index 00aac7dc..aea9744b 100644 --- a/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php +++ b/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php @@ -14,31 +14,27 @@ use eZ\Publish\Core\Query\QueryFactoryInterface; use EzSystems\EzRecommendationClient\Helper\ContentHelper; use EzSystems\EzRecommendationClient\Helper\LocationHelper; -use EzSystems\EzRecommendationClient\Service\EventNotificationService; abstract class AbstractRepositoryEventSubscriberTest extends AbstractCoreEventSubscriberTest { - /** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\ContentService */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\API\Repository\ContentService */ protected $contentServiceMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\LocationService */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\API\Repository\LocationService */ protected $locationServiceMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Helper\LocationHelper */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\EzSystems\EzRecommendationClient\Helper\LocationHelper */ protected $locationHelperMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Helper\ContentHelper */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\EzSystems\EzRecommendationClient\Helper\ContentHelper */ protected $contentHelperMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\Core\Query\QueryFactoryInterface */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\Core\Query\QueryFactoryInterface */ protected $queryFactoryMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\SearchService */ + /** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\API\Repository\SearchService */ protected $searchServiceMock; - /** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Service\EventNotificationService */ - protected $notificationServiceMock; - public function setUp(): void { parent::setUp(); @@ -49,6 +45,5 @@ public function setUp(): void $this->contentHelperMock = $this->createMock(ContentHelper::class); $this->queryFactoryMock = $this->createMock(QueryFactoryInterface::class); $this->searchServiceMock = $this->createMock(SearchService::class); - $this->notificationServiceMock = $this->createMock(EventNotificationService::class); } }