Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#4020] Import Traversable
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Mar 28, 2013
1 parent d28a635 commit 05ec89f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/Zend/Permissions/Acl/Role/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Zend\Permissions\Acl\Role;

use Traversable;
use Zend\Permissions\Acl\Exception;

class Registry
Expand All @@ -35,7 +36,7 @@ class Registry
* highest priority.
*
* @param RoleInterface $role
* @param RoleInterface|string|array|\Traversable $parents
* @param RoleInterface|string|array|Traversable $parents
* @throws Exception\InvalidArgumentException
* @return Registry Provides a fluent interface
*/
Expand All @@ -53,7 +54,7 @@ public function add(RoleInterface $role, $parents = null)
$roleParents = array();

if (null !== $parents) {
if (!is_array($parents) && !$parents instanceof \Traversable) {
if (!is_array($parents) && !$parents instanceof Traversable) {
$parents = array($parents);
}
foreach ($parents as $parent) {
Expand Down

0 comments on commit 05ec89f

Please sign in to comment.