Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,6 @@ parameters:
count: 1
path: src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php

-
message: '#^Method Ibexa\\User\\Permission\\UserPermissionsLimitationType\:\:evaluate\(\) should return bool but returns null\.$#'
identifier: return.type
count: 1
path: src/lib/Permission/UserPermissionsLimitationType.php

-
message: '#^Method Ibexa\\User\\Strategy\\DefaultThumbnailStrategy\:\:__construct\(\) has parameter \$initialsFieldDefIdentifiers with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down
12 changes: 7 additions & 5 deletions src/lib/Permission/UserPermissionsLimitationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\User\Permission;

Expand All @@ -12,6 +13,7 @@
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface;
use Ibexa\Contracts\Core\Repository\Values\User\Limitation as APILimitationValue;
use Ibexa\Contracts\Core\Repository\Values\User\Role;
use Ibexa\Contracts\Core\Repository\Values\User\UserReference as APIUserReference;
Expand Down Expand Up @@ -81,7 +83,7 @@ public function acceptValue(APILimitationValue $limitationValue): void
*
* @return \Ibexa\Contracts\Core\FieldType\ValidationError[]
*/
public function validate(APILimitationValue $limitationValue)
public function validate(APILimitationValue $limitationValue): array
{
$validationErrors = [];

Expand Down Expand Up @@ -129,7 +131,7 @@ public function validate(APILimitationValue $limitationValue)
*
* @return \Ibexa\Contracts\Core\Repository\Values\User\Limitation
*/
public function buildValue(array $limitationValues)
public function buildValue(array $limitationValues): APILimitationValue
{
return new UserPermissionsLimitation(['limitationValues' => $limitationValues]);
}
Expand All @@ -149,7 +151,7 @@ public function buildValue(array $limitationValues)
*
* @return bool
*/
public function evaluate(APILimitationValue $value, APIUserReference $currentUser, ValueObject $object, array $targets = null)
public function evaluate(APILimitationValue $value, APIUserReference $currentUser, ValueObject $object, array $targets = null): ?bool
{
if (!$value instanceof UserPermissionsLimitation) {
throw new InvalidArgumentException('$value', 'Must be of type: APISiteAccessLimitation');
Expand Down Expand Up @@ -182,7 +184,7 @@ public function evaluate(APILimitationValue $value, APIUserReference $currentUse
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface
*/
public function getCriterion(APILimitationValue $value, APIUserReference $currentUser)
public function getCriterion(APILimitationValue $value, APIUserReference $currentUser): CriterionInterface
{
throw new NotImplementedException(__METHOD__);
}
Expand All @@ -193,7 +195,7 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren
* @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name
* of that option, in case of int on of VALUE_SCHEMA_ constants.
*/
public function valueSchema()
public function valueSchema(): int|array
{
throw new NotImplementedException(__METHOD__);
}
Expand Down
Loading