public function getAll(): iterable
    {
        if ($this->permissions === null) {

            /** @var array $list */
            $list = app()->getCollector()->collect('permissions')->get();

            $key = 0;
            $names = [];
            $permissions = [];

            foreach ($list as $name => $description) {
                $permissions[] = new Permission($name, $description);
                $names[$name] = $key;
                $key++;
            }

            $this->permissions = $permissions;
            $this->names = $names;
        }

        return $this->permissions;
    }
public function getAll(): iterable
    {
        if ($this->permissions === null) {

            /** @var array $list */
            $list = app()->getCollector()->collect('permissions')->get();

            $key = 0;
            $names = [];
            $permissions = [];

            foreach ($list as $name => $description) {
                $permissions[] = new Permission($name, $description);
                $names[$name] = $key;
                $key++;
            }

            $this->permissions = $permissions;
            $this->names = $names;
        }

        return $this->permissions;
    }
public function getAll ( ) : iterable { if ( $ this -> permissions === null ) { /** @var array $list */ $ list = app ( ) -> getCollector ( ) -> collect ( 'permissions' ) -> get ( ) ; $ key = 0 ; $ names = [ ] ; $ permissions = [ ] ; foreach ( $ list as $ name => $ description ) { $ permissions [ ] = new Permission ( $ name , $ description ) ; $ names [ $ name ] = $ key ; $ key ++ ; } $ this -> permissions = $ permissions ; $ this -> names = $ names ; } return $ this -> permissions ; }
Get all permissions

@return iterable|IPermission[]
Get all permissions