Adapter\Memory->addRole() accessInherits error

Phpdocs on Phalcon\Acl\Adapter\Memory->addRole() says that $accessInherits may be array or string. Phpdocs on Phalcon\Acl\AdapterInterface->addRole() says that $accessInherits may be array. But when I call this function like this: $acl->addRole(new Acl\Role('MyRole'), ['SomeRole', 'AnotherRole']);

I received an error: Notice: Array to string conversion in ... Role 'Array' (to inherit) does not exist in the role list

Is it a bug?



81.8k

Maybe the method signature in the docs is wrong, this method doesn't support an array as parameter only an string name

It's not a good news :( Can you update phpdocs in devtools?



81.8k

You can use:

$acl->addInherit('MyRole', 'SomeRole');
$acl->addInherit('MyRole', 'AnotherRole');