From 6814430b36421f33e03dd0a8a9fd44de7906b75f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Jun 2024 16:45:56 +0200 Subject: [PATCH] Fix PHPStan issues --- GoneSubscriber/GoneDocumentSubscriber.php | 2 + GoneSubscriber/GoneEntitySubscriber.php | 31 +- Import/Converter/Converter.php | 2 + Resources/config/gone_subscriber.xml | 4 +- .../GoneDocumentSubscriberTest.php | 19 +- .../GoneEntitySubscriberTest.php | 18 +- Tests/Unit/Import/FileImportTest.php | 7 +- Tests/Unit/Import/Writer/WriterTest.php | 5 +- .../Unit/Manager/RedirectRouteManagerTest.php | 3 +- phpstan-baseline.neon | 265 ------------------ 10 files changed, 43 insertions(+), 313 deletions(-) diff --git a/GoneSubscriber/GoneDocumentSubscriber.php b/GoneSubscriber/GoneDocumentSubscriber.php index 6b62669..4cc2b84 100644 --- a/GoneSubscriber/GoneDocumentSubscriber.php +++ b/GoneSubscriber/GoneDocumentSubscriber.php @@ -25,6 +25,8 @@ /** * This gone subscriber listens for removed pages. + * + * @internal this is a internal listener which should not be used directly */ class GoneDocumentSubscriber implements EventSubscriberInterface { diff --git a/GoneSubscriber/GoneEntitySubscriber.php b/GoneSubscriber/GoneEntitySubscriber.php index 0091fc6..28dd244 100644 --- a/GoneSubscriber/GoneEntitySubscriber.php +++ b/GoneSubscriber/GoneEntitySubscriber.php @@ -16,21 +16,31 @@ use Doctrine\ORM\Events; use Sulu\Bundle\RedirectBundle\Entity\RedirectRoute; use Sulu\Bundle\RedirectBundle\Exception\RedirectRouteNotUniqueException; -use Sulu\Bundle\RedirectBundle\Manager\RedirectRouteManager; +use Sulu\Bundle\RedirectBundle\Manager\RedirectRouteManagerInterface; use Sulu\Bundle\RouteBundle\Model\RouteInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * This gone subscriber listens for removed route entities. + * + * @internal this is a internal listener which should not be used directly */ class GoneEntitySubscriber implements EventSubscriber, ContainerAwareInterface { use ContainerAwareTrait; /** - * {@inheritdoc} + * @var RedirectRouteManagerInterface */ + private $redirectRouteManager; + + public function __construct( + RedirectRouteManagerInterface $redirectRouteManager, + ) { + $this->redirectRouteManager = $redirectRouteManager; + } + public function getSubscribedEvents() { return [ @@ -42,8 +52,7 @@ public function preRemove(LifecycleEventArgs $event): void { $route = $event->getObject(); - $routeManager = $this->getRedirectRouteManager(); - if (!$route instanceof RouteInterface || null === $routeManager) { + if (!$route instanceof RouteInterface) { return; } @@ -53,21 +62,9 @@ public function preRemove(LifecycleEventArgs $event): void $redirectRoute->setSource($route->getPath()); try { - $routeManager->save($redirectRoute); + $this->redirectRouteManager->save($redirectRoute); } catch (RedirectRouteNotUniqueException $exception) { // do nothing when there already exists a redirect route } } - - /** - * @return RedirectRouteManager|null - */ - private function getRedirectRouteManager() - { - if (null === $this->container) { - return null; - } - - return $this->container->get('sulu_redirect.redirect_route_manager'); - } } diff --git a/Import/Converter/Converter.php b/Import/Converter/Converter.php index 69eafbe..1815a53 100644 --- a/Import/Converter/Converter.php +++ b/Import/Converter/Converter.php @@ -12,6 +12,7 @@ namespace Sulu\Bundle\RedirectBundle\Import\Converter; use Ramsey\Uuid\Uuid; +use Sulu\Bundle\RedirectBundle\Model\RedirectRouteInterface; use Sulu\Bundle\RedirectBundle\Model\RedirectRouteRepositoryInterface; use Symfony\Component\PropertyAccess\PropertyAccess; @@ -49,6 +50,7 @@ public function convert(array $item) $entity = $this->repository->findBySource($item[self::SOURCE]); if (!$entity) { + /** @var RedirectRouteInterface $entity */ $entity = $this->repository->createNew(); $entity->setId(Uuid::uuid4()->toString()); } diff --git a/Resources/config/gone_subscriber.xml b/Resources/config/gone_subscriber.xml index 7bd49d1..45add9f 100644 --- a/Resources/config/gone_subscriber.xml +++ b/Resources/config/gone_subscriber.xml @@ -17,9 +17,7 @@ - - - + diff --git a/Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php b/Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php index 551f0eb..d6f8f32 100644 --- a/Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php +++ b/Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php @@ -14,6 +14,7 @@ use Doctrine\ORM\EntityManager; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\Prophecy\ObjectProphecy; use Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector; use Sulu\Bundle\PageBundle\Document\BasePageDocument; use Sulu\Bundle\RedirectBundle\GoneSubscriber\GoneDocumentSubscriber; @@ -35,47 +36,47 @@ class GoneDocumentSubscriberTest extends TestCase private $goneDocumentSubscriber; /** - * @var EntityManager + * @var ObjectProphecy */ private $entityManager; /** - * @var RedirectRouteManager + * @var ObjectProphecy */ private $redirectRouteManager; /** - * @var DocumentInspector + * @var ObjectProphecy */ private $documentInspector; /** - * @var WebspaceManager + * @var ObjectProphecy */ private $webspaceManager; /** - * @var ResourceLocatorStrategyPool + * @var ObjectProphecy */ private $resourceLocatorStrategyPool; /** - * @var RemoveEvent + * @var ObjectProphecy */ private $removeEvent; /** - * @var BasePageDocument + * @var ObjectProphecy */ private $document; /** - * @var ResourceLocatorStrategyInterface + * @var ObjectProphecy */ private $resourceLocatorStrategy; /** - * @var Webspace + * @var ObjectProphecy */ private $webspace; diff --git a/Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php b/Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php index 87090cf..b68811d 100644 --- a/Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php +++ b/Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php @@ -14,6 +14,7 @@ use Doctrine\ORM\Event\LifecycleEventArgs; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\Prophecy\ObjectProphecy; use Sulu\Bundle\RedirectBundle\Entity\RedirectRoute; use Sulu\Bundle\RedirectBundle\GoneSubscriber\GoneEntitySubscriber; use Sulu\Bundle\RedirectBundle\Manager\RedirectRouteManager; @@ -28,25 +29,20 @@ class GoneEntitySubscriberTest extends TestCase private $goneEntitySubscriber; /** - * @var LifecycleEventArgs + * @var ObjectProphecy */ private $event; /** - * @var RouteInterface + * @var ObjectProphecy */ private $object; /** - * @var RedirectRouteManager + * @var ObjectProphecy */ private $redirectRouteManager; - /** - * @var ContainerInterface - */ - private $container; - protected function setUp(): void { $this->object = $this->prophesize(RouteInterface::class); @@ -62,11 +58,7 @@ protected function setUp(): void return true; }))->shouldBeCalledTimes(1); - $this->container = $this->prophesize(ContainerInterface::class); - $this->container->get('sulu_redirect.redirect_route_manager')->willReturn($this->redirectRouteManager->reveal()); - - $this->goneEntitySubscriber = new GoneEntitySubscriber(); - $this->goneEntitySubscriber->setContainer($this->container->reveal()); + $this->goneEntitySubscriber = new GoneEntitySubscriber($this->redirectRouteManager->reveal()); } public function testPreRemoveWithWrongObject() diff --git a/Tests/Unit/Import/FileImportTest.php b/Tests/Unit/Import/FileImportTest.php index fbb7ff9..00c16b5 100644 --- a/Tests/Unit/Import/FileImportTest.php +++ b/Tests/Unit/Import/FileImportTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\Prophecy\ObjectProphecy; use Sulu\Bundle\RedirectBundle\Import\Converter\Converter; use Sulu\Bundle\RedirectBundle\Import\Converter\ConverterInterface; use Sulu\Bundle\RedirectBundle\Import\Converter\ConverterNotFoundException; @@ -28,17 +29,17 @@ class FileImportTest extends TestCase { /** - * @var ReaderInterface + * @var ObjectProphecy */ private $reader; /** - * @var ConverterInterface + * @var ObjectProphecy */ private $converter; /** - * @var WriterInterface + * @var ObjectProphecy */ private $writer; diff --git a/Tests/Unit/Import/Writer/WriterTest.php b/Tests/Unit/Import/Writer/WriterTest.php index ec06d13..60ff989 100644 --- a/Tests/Unit/Import/Writer/WriterTest.php +++ b/Tests/Unit/Import/Writer/WriterTest.php @@ -13,6 +13,7 @@ use Doctrine\ORM\EntityManagerInterface; use PHPUnit\Framework\TestCase; +use Prophecy\Prophecy\ObjectProphecy; use Sulu\Bundle\RedirectBundle\Exception\RedirectRouteNotUniqueException; use Sulu\Bundle\RedirectBundle\Import\Writer\DuplicatedSourceException; use Sulu\Bundle\RedirectBundle\Import\Writer\TargetIsEmptyException; @@ -24,12 +25,12 @@ class WriterTest extends TestCase { /** - * @var RedirectRouteManagerInterface + * @var ObjectProphecy */ private $redirectRouteManager; /** - * @var EntityManagerInterface + * @var ObjectProphecy */ private $entityManager; diff --git a/Tests/Unit/Manager/RedirectRouteManagerTest.php b/Tests/Unit/Manager/RedirectRouteManagerTest.php index 4d964ae..a16ed17 100644 --- a/Tests/Unit/Manager/RedirectRouteManagerTest.php +++ b/Tests/Unit/Manager/RedirectRouteManagerTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\Prophecy\ObjectProphecy; use Sulu\Bundle\RedirectBundle\Exception\RedirectRouteNotUniqueException; use Sulu\Bundle\RedirectBundle\Manager\RedirectRouteManager; use Sulu\Bundle\RedirectBundle\Manager\RedirectRouteManagerInterface; @@ -22,7 +23,7 @@ class RedirectRouteManagerTest extends TestCase { /** - * @var RedirectRouteRepositoryInterface + * @var ObjectProphecy */ private $repository; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4736bf2..68435fa 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -30,11 +30,6 @@ parameters: count: 1 path: Exception/RedirectRouteNotUniqueException.php - - - message: "#^Call to an undefined method object\\:\\:setId\\(\\)\\.$#" - count: 1 - path: Import/Converter/Converter.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Converter\\\\ConverterFacade\\:\\:convert\\(\\) should return Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface but returns null\\.$#" count: 1 @@ -480,41 +475,6 @@ parameters: count: 1 path: Tests/Unit/Entity/RedirectRouteTest.php - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:shouldBeCalledTimes\\(\\)\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:shouldNotBeCalled\\(\\)\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Call to an undefined method Sulu\\\\Component\\\\DocumentManager\\\\Event\\\\RemoveEvent\\:\\:reveal\\(\\)\\.$#" - count: 2 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Call to an undefined method object\\:\\:willReturn\\(\\)\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Cannot call method shouldBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Cannot call method shouldNotBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManager\\:\\:saveByData\\(\\) invoked with 0 parameters, 1 required\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:testCreateRedirects\\(\\) has no return type specified\\.$#" count: 1 @@ -525,76 +485,6 @@ parameters: count: 1 path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - message: "#^Parameter \\#1 \\$data of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManager\\:\\:saveByData\\(\\) expects array, Prophecy\\\\Argument\\\\Token\\\\AnyValueToken given\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$document \\(Sulu\\\\Bundle\\\\PageBundle\\\\Document\\\\BasePageDocument\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$documentInspector \\(Sulu\\\\Bundle\\\\DocumentManagerBundle\\\\Bridge\\\\DocumentInspector\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$entityManager \\(Doctrine\\\\ORM\\\\EntityManager\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$redirectRouteManager \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManager\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$removeEvent \\(Sulu\\\\Component\\\\DocumentManager\\\\Event\\\\RemoveEvent\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$resourceLocatorStrategy \\(Sulu\\\\Component\\\\Content\\\\Types\\\\ResourceLocator\\\\Strategy\\\\ResourceLocatorStrategyInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$resourceLocatorStrategyPool \\(Sulu\\\\Component\\\\Content\\\\Types\\\\ResourceLocator\\\\Strategy\\\\ResourceLocatorStrategyPool\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$webspace \\(Sulu\\\\Component\\\\Webspace\\\\Webspace\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneDocumentSubscriberTest\\:\\:\\$webspaceManager \\(Sulu\\\\Component\\\\Webspace\\\\Manager\\\\WebspaceManager\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Result of method Doctrine\\\\ORM\\\\EntityManager\\:\\:flush\\(\\) \\(void\\) is used\\.$#" - count: 2 - path: Tests/Unit/GoneSubscriber/GoneDocumentSubscriberTest.php - - - - message: "#^Call to an undefined method Doctrine\\\\ORM\\\\Event\\\\LifecycleEventArgs\\:\\:reveal\\(\\)\\.$#" - count: 2 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:shouldNotBeCalled\\(\\)\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManager\\:\\:save\\(\\) invoked with 0 parameters, 1 required\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneEntitySubscriberTest\\:\\:testPreRemove\\(\\) has no return type specified\\.$#" count: 1 @@ -605,26 +495,6 @@ parameters: count: 1 path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneEntitySubscriberTest\\:\\:\\$container \\(Symfony\\\\Component\\\\DependencyInjection\\\\ContainerInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneEntitySubscriberTest\\:\\:\\$event \\(Doctrine\\\\ORM\\\\Event\\\\LifecycleEventArgs\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneEntitySubscriberTest\\:\\:\\$object \\(Sulu\\\\Bundle\\\\RouteBundle\\\\Model\\\\RouteInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\GoneSubscriber\\\\GoneEntitySubscriberTest\\:\\:\\$redirectRouteManager \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManager\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/GoneSubscriber/GoneEntitySubscriberTest.php - - message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNull\\(\\) with Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface will always evaluate to false\\.$#" count: 2 @@ -680,31 +550,6 @@ parameters: count: 1 path: Tests/Unit/Import/Converter/ConverterTest.php - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:willReturn\\(\\)\\.$#" - count: 2 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Cannot call method shouldBeCalled\\(\\) on void\\.$#" - count: 4 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Cannot call method shouldNotBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Cannot call method willReturn\\(\\) on array\\\\.$#" - count: 3 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Cannot call method willReturn\\(\\) on bool\\.$#" - count: 7 - path: Tests/Unit/Import/FileImportTest.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\FileImportTest\\:\\:testImport\\(\\) has no return type specified\\.$#" count: 1 @@ -725,41 +570,6 @@ parameters: count: 1 path: Tests/Unit/Import/FileImportTest.php - - - message: "#^Parameter \\#1 \\$entity of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Writer\\\\WriterInterface\\:\\:write\\(\\) expects Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface, Prophecy\\\\Argument\\\\Token\\\\AnyValueToken given\\.$#" - count: 1 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Parameter \\#1 \\$entity of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Writer\\\\WriterInterface\\:\\:write\\(\\) expects Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface, Prophecy\\\\Prophecy\\\\ObjectProphecy\\ given\\.$#" - count: 2 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\FileImportTest\\:\\:\\$converter \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Converter\\\\ConverterInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\FileImportTest\\:\\:\\$reader \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Reader\\\\ReaderInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\FileImportTest\\:\\:\\$writer \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Writer\\\\WriterInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Result of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Writer\\\\WriterInterface\\:\\:finalize\\(\\) \\(void\\) is used\\.$#" - count: 2 - path: Tests/Unit/Import/FileImportTest.php - - - - message: "#^Result of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Import\\\\Writer\\\\WriterInterface\\:\\:write\\(\\) \\(void\\) is used\\.$#" - count: 3 - path: Tests/Unit/Import/FileImportTest.php - - message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNull\\(\\) with array\\ will always evaluate to false\\.$#" count: 2 @@ -805,31 +615,6 @@ parameters: count: 1 path: Tests/Unit/Import/Reader/ReaderFacadeTest.php - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:shouldBeCalled\\(\\)\\.$#" - count: 11 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Call to an undefined method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\:\\:shouldNotBeCalled\\(\\)\\.$#" - count: 3 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Cannot call method shouldBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Cannot call method shouldBeCalledTimes\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Cannot call method shouldNotBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/Import/Writer/WriterTest.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\Writer\\\\WriterTest\\:\\:testFinalize\\(\\) has no return type specified\\.$#" count: 1 @@ -870,41 +655,6 @@ parameters: count: 1 path: Tests/Unit/Import/Writer/WriterTest.php - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\Writer\\\\WriterTest\\:\\:\\$entityManager \\(Doctrine\\\\ORM\\\\EntityManagerInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Import\\\\Writer\\\\WriterTest\\:\\:\\$redirectRouteManager \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Manager\\\\RedirectRouteManagerInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Result of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:flush\\(\\) \\(void\\) is used\\.$#" - count: 3 - path: Tests/Unit/Import/Writer/WriterTest.php - - - - message: "#^Call to an undefined method object\\:\\:willReturn\\(\\)\\.$#" - count: 3 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - - message: "#^Cannot call method shouldBeCalled\\(\\) on void\\.$#" - count: 4 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - - message: "#^Cannot call method shouldNotBeCalled\\(\\) on void\\.$#" - count: 1 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - - message: "#^Cannot call method willReturn\\(\\) on Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteInterface\\|null\\.$#" - count: 5 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - message: "#^Method Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Manager\\\\RedirectRouteManagerTest\\:\\:testDelete\\(\\) has no return type specified\\.$#" count: 1 @@ -930,21 +680,6 @@ parameters: count: 1 path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - message: "#^Property Sulu\\\\Bundle\\\\RedirectBundle\\\\Tests\\\\Unit\\\\Manager\\\\RedirectRouteManagerTest\\:\\:\\$repository \\(Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteRepositoryInterface\\) does not accept Prophecy\\\\Prophecy\\\\ObjectProphecy\\\\.$#" - count: 1 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - - message: "#^Result of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteRepositoryInterface\\:\\:persist\\(\\) \\(void\\) is used\\.$#" - count: 4 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - - - message: "#^Result of method Sulu\\\\Bundle\\\\RedirectBundle\\\\Model\\\\RedirectRouteRepositoryInterface\\:\\:remove\\(\\) \\(void\\) is used\\.$#" - count: 1 - path: Tests/Unit/Manager/RedirectRouteManagerTest.php - - message: "#^Cannot call method getDefaults\\(\\) on Symfony\\\\Component\\\\Routing\\\\Route\\|null\\.$#" count: 2