ZF-Commons / zfc-rbac

Role-based access control module to provide additional features on top of Zend\Permissions\Rbac
BSD 3-Clause "New" or "Revised" License
181 stars 111 forks source link

HierarchicalRoleInterface problem #387

Closed svycka closed 5 years ago

svycka commented 5 years ago

here https://github.com/ZF-Commons/zfc-rbac/blob/develop/src/Role/HierarchicalRoleInterface.php#L36 maybe we could change the return type to iterable?

public function getChildren(): array;
// to
public function getChildren(): iterable;

Then when working with doctrine I could just return ArrayCollection, but now I have to do this:

public function getChildren(): array
{
    return $this->children->toArray();
}
basz commented 5 years ago

Sounds reasonable