From dde061e0c526732c31caccce28cd3a509482de3b Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Tue, 12 Dec 2023 19:32:46 +0600 Subject: [PATCH] Make SimpleAssignmentsStorage::$assignments protected --- src/Manager.php | 2 +- src/SimpleAssignmentsStorage.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index cb8bc6c1..92df8200 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -411,7 +411,7 @@ private function assertFutureChild(string $parentName, string $childName): void throw new RuntimeException("Child \"$childName\" does not exist."); } - if ($parent->getType() === Item::TYPE_PERMISSION && $child->getType() === Item::TYPE_ROLE) { + if ($parent instanceof Permission && $child instanceof Role) { throw new RuntimeException( "Can not add \"$childName\" role as a child of \"$parentName\" permission.", ); diff --git a/src/SimpleAssignmentsStorage.php b/src/SimpleAssignmentsStorage.php index f92574bb..83cd2d78 100644 --- a/src/SimpleAssignmentsStorage.php +++ b/src/SimpleAssignmentsStorage.php @@ -11,7 +11,7 @@ abstract class SimpleAssignmentsStorage implements AssignmentsStorageInterface /** * @psalm-var array> */ - private array $assignments = []; + protected array $assignments = []; public function getAll(): array {