public function getByName(string $name): ?IPermission
    {
        if ($this->permissions === null) {
            $this->getAll();
        }

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

        return $this->permissions[$this->names[$name]];
    }
public function getByName(string $name): ?IPermission
    {
        if ($this->permissions === null) {
            $this->getAll();
        }

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

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

@param string $name
@return null|IPermission
Get permission by its name