diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7951a805de..15dc8c0342 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6980,11 +6980,6 @@ parameters: count: 1 path: src/contracts/Repository/PermissionCriterionResolver.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\PermissionResolver\\:\\:hasAccess\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/PermissionResolver.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:findContent\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" count: 1 @@ -20575,11 +20570,6 @@ parameters: count: 1 path: src/lib/Repository/Permission/CachedPermissionService.php - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\CachedPermissionService\\:\\:hasAccess\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/Permission/CachedPermissionService.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\CachedPermissionService\\:\\:sudo\\(\\) has no return type specified\\.$#" count: 1 @@ -20635,11 +20625,6 @@ parameters: count: 1 path: src/lib/Repository/Permission/PermissionResolver.php - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\PermissionResolver\\:\\:hasAccess\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/Permission/PermissionResolver.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\PermissionResolver\\:\\:isDeniedByRoleLimitation\\(\\) has parameter \\$targets with no value type specified in iterable type array\\.$#" count: 1 @@ -34525,11 +34510,6 @@ parameters: count: 11 path: tests/integration/Core/Repository/LocationServiceTest.php - - - message: "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#" - count: 1 - path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Cannot call method getContentInfo\\(\\) on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#" count: 2 @@ -44475,11 +44455,6 @@ parameters: count: 1 path: tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php - - - message: "#^Cannot call method fetchAllAssociative\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#" - count: 4 - path: tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\FieldType\\\\Url\\\\Gateway\\\\DoctrineStorageTest\\:\\:testGetIdUrlMap\\(\\) has no return type specified\\.$#" count: 1 @@ -51320,11 +51295,6 @@ parameters: count: 1 path: tests/lib/Persistence/Legacy/Content/FieldValueConverterRegistryTest.php - - - message: "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#" - count: 5 - path: tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Gateway\\\\DoctrineDatabaseTest\\:\\:assertContentVersionAttributesLanguages\\(\\) has parameter \\$expectation with no value type specified in iterable type array\\.$#" count: 1 @@ -51930,11 +51900,6 @@ parameters: count: 1 path: tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.php - - - message: "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#" - count: 1 - path: tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Location\\\\Gateway\\\\DoctrineDatabaseTest\\:\\:assertLoadLocationProperties\\(\\) has parameter \\$locationData with no value type specified in iterable type array\\.$#" count: 1 @@ -54350,11 +54315,6 @@ parameters: count: 4 path: tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.php - - - message: "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#" - count: 1 - path: tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\UrlAlias\\\\UrlAliasHandlerTest\\:\\:assertVirtualUrlAliasValid\\(\\) has no return type specified\\.$#" count: 1 diff --git a/src/contracts/Repository/PermissionResolver.php b/src/contracts/Repository/PermissionResolver.php index d4d8dd3a09..b8ad3fa1db 100644 --- a/src/contracts/Repository/PermissionResolver.php +++ b/src/contracts/Repository/PermissionResolver.php @@ -48,6 +48,13 @@ public function setCurrentUserReference(UserReference $userReference): void; * which the information is returned, current user will be used if null * * @return bool|array if limitations are on this function an array of limitations is returned + * + * @phpstan-return bool|array< + * array{ + * limitation: \Ibexa\Contracts\Core\Repository\Values\User\Limitation|null, + * policies: array<\Ibexa\Contracts\Core\Repository\Values\User\Policy> + * }, + * > */ public function hasAccess(string $module, string $function, ?UserReference $userReference = null);