original_string: public function init($modules = null)
      {
          if (!isset($modules)) {
              $modules = $this->module->getEnabled();
          }
  
          foreach ((array) $modules as $module) {
  
              if (empty($module['hooks'])) {
                  continue;
              }
  
              foreach ($module['hooks'] as $method) {
                  $this->register($method, $module['class']);
              }
          }
  
          return $this->hooks;
      }
code: public function init($modules = null)
      {
          if (!isset($modules)) {
              $modules = $this->module->getEnabled();
          }
  
          foreach ((array) $modules as $module) {
  
              if (empty($module['hooks'])) {
                  continue;
              }
  
              foreach ($module['hooks'] as $method) {
                  $this->register($method, $module['class']);
              }
          }
  
          return $this->hooks;
      }
code_tokens: public function init ( $ modules = null ) { if ( ! isset ( $ modules ) ) { $ modules = $ this -> module -> getEnabled ( ) ; } foreach ( ( array ) $ modules as $ module ) { if ( empty ( $ module [ 'hooks' ] ) ) { continue ; } foreach ( $ module [ 'hooks' ] as $ method ) { $ this -> register ( $ method , $ module [ 'class' ] ) ; } } return $ this -> hooks ; }
docstring: Registers module hooks
  @param array|null $modules
  @return array
docstring_tokens: Registers module hooks