src/Manager.php
public function addPermission($permission)
    {
        if (is_string($permission)) {
            $name       = $permission;
            $permission = $this->createPermission($name);
        } elseif ($permission instanceof PermissionInterface) {
            $name = $permission->getName();
        } else {
            throw new \InvalidArgumentException('Permission must be a string or implement PermissionInterface');
        }

        $this->permissions[$name] = $permission;
        return $permission;
    }
public function addPermission($permission)
    {
        if (is_string($permission)) {
            $name       = $permission;
            $permission = $this->createPermission($name);
        } elseif ($permission instanceof PermissionInterface) {
            $name = $permission->getName();
        } else {
            throw new \InvalidArgumentException('Permission must be a string or implement PermissionInterface');
        }

        $this->permissions[$name] = $permission;
        return $permission;
    }
public function addPermission ( $ permission ) { if ( is_string ( $ permission ) ) { $ name = $ permission ; $ permission = $ this -> createPermission ( $ name ) ; } elseif ( $ permission instanceof PermissionInterface ) { $ name = $ permission -> getName ( ) ; } else { throw new \ InvalidArgumentException ( 'Permission must be a string or implement PermissionInterface' ) ; } $ this -> permissions [ $ name ] = $ permission ; return $ permission ; }
Adds a permission to the RBAC system.

@param string|PermissionInterface $permission
@return PermissionInterface
Adds a permission to the RBAC system .