From d544a9005e5cac4f837367c82019693b4742761c Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Tue, 26 Nov 2024 11:12:55 +0100 Subject: [PATCH] Fixed typing in PermissionCriterionResolver --- phpstan-baseline.neon | 10 ---------- .../Repository/PermissionCriterionResolver.php | 2 +- .../Repository/Permission/CachedPermissionService.php | 2 +- .../Permission/PermissionCriterionResolver.php | 6 ------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2353c687e7..dd62882ae0 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -19240,11 +19240,6 @@ parameters: count: 1 path: src/lib/Repository/Permission/CachedPermissionService.php - - - message: "#^Property Ibexa\\\\Core\\\\Repository\\\\Permission\\\\CachedPermissionService\\:\\:\\$permissionCriterion \\(bool\\|Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\Criterion\\) does not accept null\\.$#" - count: 1 - path: src/lib/Repository/Permission/CachedPermissionService.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\LimitationService\\:\\:__construct\\(\\) has parameter \\$limitationTypes with no value type specified in iterable type Traversable\\.$#" count: 1 @@ -19265,11 +19260,6 @@ parameters: count: 1 path: src/lib/Repository/Permission/PermissionCriterionResolver.php - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Permission\\\\PermissionCriterionResolver\\:\\:getPermissionsCriterion\\(\\) should return bool\\|Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\Criterion but returns Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\CriterionInterface\\.$#" - count: 1 - path: src/lib/Repository/Permission/PermissionCriterionResolver.php - - message: "#^PHPDoc tag @var does not specify variable name\\.$#" count: 1 diff --git a/src/contracts/Repository/PermissionCriterionResolver.php b/src/contracts/Repository/PermissionCriterionResolver.php index 85abe187f6..10a447c544 100644 --- a/src/contracts/Repository/PermissionCriterionResolver.php +++ b/src/contracts/Repository/PermissionCriterionResolver.php @@ -27,7 +27,7 @@ interface PermissionCriterionResolver * @param string $function * @param array|null $targets * - * @return bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion + * @return bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface */ public function getPermissionsCriterion(string $module = 'content', string $function = 'read', ?array $targets = null); diff --git a/src/lib/Repository/Permission/CachedPermissionService.php b/src/lib/Repository/Permission/CachedPermissionService.php index 399fec981a..4f29d3a5e8 100644 --- a/src/lib/Repository/Permission/CachedPermissionService.php +++ b/src/lib/Repository/Permission/CachedPermissionService.php @@ -52,7 +52,7 @@ class CachedPermissionService implements PermissionService * * Value is null if not yet set or cleared. * - * @var bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion + * @var null|bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface */ private $permissionCriterion; diff --git a/src/lib/Repository/Permission/PermissionCriterionResolver.php b/src/lib/Repository/Permission/PermissionCriterionResolver.php index 30c6f1019a..9aa0880372 100644 --- a/src/lib/Repository/Permission/PermissionCriterionResolver.php +++ b/src/lib/Repository/Permission/PermissionCriterionResolver.php @@ -49,12 +49,6 @@ public function __construct( * * @uses \Ibexa\Contracts\Core\Repository\PermissionResolver::getCurrentUserReference() * @uses \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() - * - * @param string $module - * @param string $function - * @param array $targets - * - * @return bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion */ public function getPermissionsCriterion(string $module = 'content', string $function = 'read', ?array $targets = null) {