Skip to content

Commit

Permalink
Specified return type for PermissionResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p authored Feb 5, 2024
1 parent 2c8459d commit 12b3b45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 40 deletions.
40 changes: 0 additions & 40 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/contracts/Repository/PermissionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 12b3b45

Please sign in to comment.