diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6f9a93a04f..8945354fb5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8205,11 +8205,6 @@ parameters: count: 1 path: src/lib/Base/Exceptions/InvalidArgumentType.php - - - message: "#^Access to an undefined property Ibexa\\\\Core\\\\Base\\\\Exceptions\\\\LimitationValidationException\\:\\:\\$validationErrors\\.$#" - count: 1 - path: src/lib/Base/Exceptions/LimitationValidationException.php - - message: "#^Method Ibexa\\\\Core\\\\Base\\\\Exceptions\\\\LimitationValidationException\\:\\:addParameter\\(\\) has no return type specified\\.$#" count: 1 @@ -24015,11 +24010,6 @@ parameters: count: 1 path: tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\LanguagesTest\\:\\:\\$minimalConfig\\.$#" - count: 1 - path: tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\LanguagesTest\\:\\:getMinimalConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -24990,11 +24980,6 @@ parameters: count: 1 path: tests/bundle/Core/EventListener/RequestEventListenerTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\RoutingListenerTest\\:\\:\\$container\\.$#" - count: 1 - path: tests/bundle/Core/EventListener/RoutingListenerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\RoutingListenerTest\\:\\:testGetSubscribedEvents\\(\\) has no return type specified\\.$#" count: 1 @@ -25045,11 +25030,6 @@ parameters: count: 1 path: tests/bundle/Core/EventListener/SessionInitByPostListenerTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\SessionSetDynamicNameListenerTest\\:\\:\\$session\\.$#" - count: 1 - path: tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\SessionSetDynamicNameListenerTest\\:\\:onSiteAccessMatchProvider\\(\\) has no return type specified\\.$#" count: 1 @@ -26185,11 +26165,6 @@ parameters: count: 1 path: tests/bundle/Core/Routing/JsRouting/ExposedRoutesExtractorTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\Routing\\\\UrlAliasRouterTest\\:\\:\\$container\\.$#" - count: 1 - path: tests/bundle/Core/Routing/UrlAliasRouterTest.php - - message: "#^Call to an undefined method Ibexa\\\\Core\\\\MVC\\\\Symfony\\\\Routing\\\\UrlAliasRouter\\:\\:setConfigResolver\\(\\)\\.$#" count: 1 @@ -49240,11 +49215,6 @@ parameters: count: 1 path: tests/lib/Pagination/LocationSearchHitAdapterTest.php - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$defaultLifetime\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Cache\\\\AbstractBaseHandlerTest\\:\\:getCacheItem\\(\\) has parameter \\$key with no type specified\\.$#" count: 1 @@ -49520,16 +49490,6 @@ parameters: count: 3 path: tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$defaultLifetime\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php - - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$prevTags\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Cache\\\\Adapter\\\\InMemoryClearingProxyAdapterTest\\:\\:arrayAsGenerator\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#" count: 1 diff --git a/src/lib/Base/Exceptions/LimitationValidationException.php b/src/lib/Base/Exceptions/LimitationValidationException.php index e826b2f657..a5af9facb6 100644 --- a/src/lib/Base/Exceptions/LimitationValidationException.php +++ b/src/lib/Base/Exceptions/LimitationValidationException.php @@ -35,7 +35,7 @@ class LimitationValidationException extends APILimitationValidationException imp */ public function __construct(array $errors) { - $this->validationErrors = $errors; + $this->errors = $errors; $this->setMessageTemplate('Limitations did not validate'); parent::__construct($this->getBaseTranslation()); } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php index e3d91b5296..b610cd1b5f 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php @@ -20,7 +20,7 @@ protected function getContainerExtensions(): array protected function getMinimalConfiguration(): array { - return $this->minimalConfig = Yaml::parse(file_get_contents(__DIR__ . '/../../Fixtures/ezpublish_minimal.yml')); + return Yaml::parse(file_get_contents(__DIR__ . '/../../Fixtures/ezpublish_minimal.yml')); } public function testLanguagesSingleSiteaccess() diff --git a/tests/bundle/Core/EventListener/RoutingListenerTest.php b/tests/bundle/Core/EventListener/RoutingListenerTest.php index e6dbf63ee7..062022db67 100644 --- a/tests/bundle/Core/EventListener/RoutingListenerTest.php +++ b/tests/bundle/Core/EventListener/RoutingListenerTest.php @@ -15,7 +15,6 @@ use Ibexa\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator; use Ibexa\Core\MVC\Symfony\SiteAccess; use PHPUnit\Framework\TestCase; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; @@ -33,7 +32,6 @@ class RoutingListenerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->container = $this->createMock(ContainerInterface::class); $this->configResolver = $this->createMock(ConfigResolverInterface::class); $this->urlAliasRouter = $this->createMock(UrlAliasRouter::class); $this->urlAliasGenerator = $this->createMock(UrlAliasGenerator::class); diff --git a/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php b/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php index 7654eae3b7..9e99dddb69 100644 --- a/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php +++ b/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php @@ -15,7 +15,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\SessionInterface as SymfonySessionInterface; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface; @@ -38,9 +37,6 @@ protected function setUp(): void $this->configResolver = $this->getMockBuilder(ConfigResolverInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->session = $this->getMockBuilder(SymfonySessionInterface::class) - ->disableOriginalConstructor() - ->getMock(); $this->sessionStorage = $this->getMockBuilder(NativeSessionStorage::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/bundle/Core/Routing/UrlAliasRouterTest.php b/tests/bundle/Core/Routing/UrlAliasRouterTest.php index e4327497fd..39f8c8c626 100644 --- a/tests/bundle/Core/Routing/UrlAliasRouterTest.php +++ b/tests/bundle/Core/Routing/UrlAliasRouterTest.php @@ -18,7 +18,6 @@ use Ibexa\Core\MVC\Symfony\View\Manager as ViewManager; use Ibexa\Core\Repository\Values\Content\Location; use Ibexa\Tests\Core\MVC\Symfony\Routing\UrlAliasRouterTest as BaseUrlAliasRouterTest; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\RequestContext; @@ -59,7 +58,6 @@ protected function getRouter(LocationService $locationService, URLAliasService $ protected function resetConfigResolver() { $this->configResolver = $this->createMock(ConfigResolverInterface::class); - $this->container = $this->createMock(ContainerInterface::class); $this->router->setConfigResolver($this->configResolver); } diff --git a/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php b/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php index 8577ef7117..4495f26423 100644 --- a/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php +++ b/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php @@ -117,7 +117,7 @@ static function ($key, $value, $isHit, $defaultLifetime = 0) { $item->key = $key; $item->value = $value; $item->isHit = $isHit; - $item->defaultLifetime = $defaultLifetime; + $item->expiresAfter($defaultLifetime); $item->isTaggable = true; return $item; diff --git a/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php b/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php index d763cd9e84..7340251524 100644 --- a/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php +++ b/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php @@ -49,11 +49,12 @@ protected function setUp(): void $this->cacheItemsClosure = \Closure::bind( static function ($key, $value, $isHit, $defaultLifetime = 0, $tags = []) { $item = new CacheItem(); + $item->isTaggable = true; $item->key = $key; $item->value = $value; $item->isHit = $isHit; - $item->prevTags = $tags; - $item->defaultLifetime = $defaultLifetime; + $item->tag($tags); + $item->expiresAfter($defaultLifetime); return $item; },