original_string: public function listPermissions()
      {
          if ($this->permissionCache !== false) {
              return $this->permissionCache;
          }
  
          /*
           * Load module items
           */
          foreach ($this->callbacks as $callback) {
              $callback($this);
          }
  
          /*
           * Load plugin items
           */
          $plugins = PluginManager::instance()->getPlugins();
  
          foreach ($plugins as $id => $plugin) {
              $items = $plugin->registerPermissions();
              if (!is_array($items)) {
                  continue;
              }
  
              $this->registerPermissions($id, $items);
          }
  
          /*
           * Sort permission items
           */
          usort($this->permissions, function ($a, $b) {
              if ($a->order == $b->order) {
                  return 0;
              }
  
              return $a->order > $b->order ? 1 : -1;
          });
  
          return $this->permissionCache = $this->permissions;
      }
code: public function listPermissions()
      {
          if ($this->permissionCache !== false) {
              return $this->permissionCache;
          }
  
          /*
           * Load module items
           */
          foreach ($this->callbacks as $callback) {
              $callback($this);
          }
  
          /*
           * Load plugin items
           */
          $plugins = PluginManager::instance()->getPlugins();
  
          foreach ($plugins as $id => $plugin) {
              $items = $plugin->registerPermissions();
              if (!is_array($items)) {
                  continue;
              }
  
              $this->registerPermissions($id, $items);
          }
  
          /*
           * Sort permission items
           */
          usort($this->permissions, function ($a, $b) {
              if ($a->order == $b->order) {
                  return 0;
              }
  
              return $a->order > $b->order ? 1 : -1;
          });
  
          return $this->permissionCache = $this->permissions;
      }
code_tokens: public function listPermissions ( ) { if ( $ this -> permissionCache !== false ) { return $ this -> permissionCache ; } /*
           * Load module items
           */ foreach ( $ this -> callbacks as $ callback ) { $ callback ( $ this ) ; } /*
           * Load plugin items
           */ $ plugins = PluginManager :: instance ( ) -> getPlugins ( ) ; foreach ( $ plugins as $ id => $ plugin ) { $ items = $ plugin -> registerPermissions ( ) ; if ( ! is_array ( $ items ) ) { continue ; } $ this -> registerPermissions ( $ id , $ items ) ; } /*
           * Sort permission items
           */ usort ( $ this -> permissions , function ( $ a , $ b ) { if ( $ a -> order == $ b -> order ) { return 0 ; } return $ a -> order > $ b -> order ? 1 : - 1 ; } ) ; return $ this -> permissionCache = $ this -> permissions ; }
docstring: Returns a list of the registered permissions items.
  @return array
docstring_tokens: Returns a list of the registered permissions items .