public function inherits(string ...$roles)
    {
        foreach ($roles as $role)
        {
            if (!$this->roleRegistry->exists($role)) {
                throw new \Exception(
                    sprintf(
                        "The role: %s doesnt exist",
                        (string)$role
                    )
                );
            }

            $this->roleRegistry->setRegistryValue($this->session["role"], $role);
        }

        $this->initSession();
    }
public function inherits(string ...$roles)
    {
        foreach ($roles as $role)
        {
            if (!$this->roleRegistry->exists($role)) {
                throw new \Exception(
                    sprintf(
                        "The role: %s doesnt exist",
                        (string)$role
                    )
                );
            }

            $this->roleRegistry->setRegistryValue($this->session["role"], $role);
        }

        $this->initSession();
    }
public function inherits ( string ... $ roles ) { foreach ( $ roles as $ role ) { if ( ! $ this -> roleRegistry -> exists ( $ role ) ) { throw new \ Exception ( sprintf ( "The role: %s doesnt exist" , ( string ) $ role ) ) ; } $ this -> roleRegistry -> setRegistryValue ( $ this -> session [ "role" ] , $ role ) ; } $ this -> initSession ( ) ; }
Allows roles to inherit from the registries of other roles

@param string[] $roles
Allows roles to inherit from the registries of other roles