src/Repositories/RoleRepository.php
public function getByName(string $role): ?IRole
    {
        if (null === $this->roles) {
            $this->getAll();
        }

        if (!isset($this->names[$role])) {
            return null;
        }

        return $this->roles[$this->names[$role]];
    }
public function getByName(string $role): ?IRole
    {
        if (null === $this->roles) {
            $this->getAll();
        }

        if (!isset($this->names[$role])) {
            return null;
        }

        return $this->roles[$this->names[$role]];
    }
public function getByName ( string $ role ) : ? IRole { if ( null === $ this -> roles ) { $ this -> getAll ( ) ; } if ( ! isset ( $ this -> names [ $ role ] ) ) { return null ; } return $ this -> roles [ $ this -> names [ $ role ] ] ; }
Get a role by its name

@param string $role
@return null|IRole
Get a role by its name