From dcca468dfe80c94feee5bed0ac7c70790604ac57 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 11 Oct 2023 14:58:17 +0200 Subject: [PATCH] Fixed incorrect type-hint for Repository Exceptions contracts (#279) For more details see https://github.com/ibexa/core/pull/279 * Fixed incorrect type-hint for Repository Exceptions contracts * [PHPStan] Dropped obsolete error report in tests/.../FilterTest.php --- phpstan-baseline.neon | 5 ----- src/contracts/Persistence/Content/UrlAlias/Handler.php | 2 +- src/contracts/Repository/UserPreferenceService.php | 2 +- src/lib/Base/Container/ApiLoader/RepositoryFactory.php | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6cf3b7b003..60485190d5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -62040,11 +62040,6 @@ parameters: count: 1 path: tests/lib/Repository/Values/ContentType/FieldDefinitionCollectionTest.php - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertContainsEquals\\(\\) with Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\SortClause\\\\Location\\\\Priority and array\\{\\} will always evaluate to false\\.$#" - count: 1 - path: tests/lib/Repository/Values/Filter/FilterTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Filter\\\\FilterTest\\:\\:getComplexFilterTestData\\(\\) return type has no value type specified in iterable type iterable\\.$#" count: 1 diff --git a/src/contracts/Persistence/Content/UrlAlias/Handler.php b/src/contracts/Persistence/Content/UrlAlias/Handler.php index e4e4be40a8..1899770d73 100644 --- a/src/contracts/Persistence/Content/UrlAlias/Handler.php +++ b/src/contracts/Persistence/Content/UrlAlias/Handler.php @@ -204,7 +204,7 @@ public function deleteCorruptedUrlAliases(); * * @param int $locationId * - * @throws \Ibexa\Core\Base\Exceptions\BadStateException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException */ public function repairBrokenUrlAliasesForLocation(int $locationId); } diff --git a/src/contracts/Repository/UserPreferenceService.php b/src/contracts/Repository/UserPreferenceService.php index c5400fb5e1..62ad0b2925 100644 --- a/src/contracts/Repository/UserPreferenceService.php +++ b/src/contracts/Repository/UserPreferenceService.php @@ -24,7 +24,7 @@ interface UserPreferenceService * @param \Ibexa\Contracts\Core\Repository\Values\UserPreference\UserPreferenceSetStruct[] $userPreferenceSetStructs * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException If the current user user is not allowed to set user preference - * @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException If the $userPreferenceSetStruct is invalid + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException If the $userPreferenceSetStruct is invalid */ public function setUserPreference(array $userPreferenceSetStructs): void; diff --git a/src/lib/Base/Container/ApiLoader/RepositoryFactory.php b/src/lib/Base/Container/ApiLoader/RepositoryFactory.php index c3703ee72b..3dbeec5971 100644 --- a/src/lib/Base/Container/ApiLoader/RepositoryFactory.php +++ b/src/lib/Base/Container/ApiLoader/RepositoryFactory.php @@ -121,7 +121,7 @@ public function buildRepository( * @param \Ibexa\Contracts\Core\Repository\Repository $repository * @param string $serviceName * - * @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException * * @return mixed */