LM-Commons / LmcRbacMvc

Role-based access control Laminas MVC module to provide additional features on top of Laminas\Permissions\Rbac
https://lm-commons.github.io/LmcRbacMvc/
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Package incompatible with php 8.1 #27

Closed juizmill closed 2 weeks ago

juizmill commented 2 years ago

I tested using this package with php 8.1 and it generated the following error.

During inheritance of ArrayIterator: Uncaught Whoops\Exception\ErrorException: Return type of Rbac\Traversal\RecursiveRoleIterator::valid() should either be compatible with ArrayIterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/zfr/rbac/src/Rbac/Traversal/RecursiveRoleIterator.php:37 Stack trace: #0 /var/www/html/vendor/zfr/rbac/src/Rbac/Traversal/RecursiveRoleIterator.php(18): Whoops\Run->handleError() #1 /var/www/html/vendor/composer/ClassLoader.php(571): include('/var/www/html/v...') #2 /var/www/html/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile() #3 /var/www/html/vendor/lm-commons/lmc-rbac-mvc/src/Collector/RbacCollector.php(161): Composer\Autoload\ClassLoader->loadClass() #4 /var/www/html/vendor/lm-commons/lmc-rbac-mvc/src/Collector/RbacCollector.php(111): LmcRbacMvc\Collector\RbacCollector->collectIdentityRolesAndPermissions() #5 /var/www/html/vendor/laminas/laminas-developer-tools/src/Profiler.php(202): LmcRbacMvc\Collector\RbacCollector->collect() #6 /var/www/html/vendor/laminas/laminas-developer-tools/src/Listener/ProfilerListener.php(86): Laminas\DeveloperTools\Profiler->collect() #7 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\DeveloperTools\Listener\ProfilerListener->onFinish() #8 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners() #9 /var/www/html/vendor/laminas/laminas-mvc/src/Application.php(334): Laminas\EventManager\EventManager->triggerEvent() #10 /var/www/html/public/index.php(41): Laminas\Mvc\Application->run() #11 {main}
visto9259 commented 2 years ago

The issue seems to be in zfr/rbac and not in this package. zfr/rbac is pretty old and no longer maintained. It's one of the enhancements (Issue #3) that needs to be done but time is lacking on my part to get it done.

visto9259 commented 2 weeks ago

Should be fixed with version 3.4.0