original_string: public function registerAssetBundle($name)
      {
          if (($bundle = $this->getAssetBundleFromView($name)) === false) {
              return $bundle;
          }
  
          $config = $this->getConfig();
  
          if (!($module = $config->getModule($name))) {
              $module = $config->addModule($name);
          }
  
          $options = $bundle->jsOptions;
  
          if (!isset($options['position'])) {
              $options['position'] = View::POS_END;
          }
  
          $options['baseUrl'] = $bundle->baseUrl;
  
          $module->setOptions($options);
  
          // TODO: think about optimization
          foreach ($bundle->depends as $dependency) {
              if (($dependency = $this->registerAssetBundle($dependency)) !== false) {
                  $module->addDependency($dependency);
              }
          }
  
          $this->importJsFilesFromBundle($bundle, $module);
  
          return $module;
      }
code: public function registerAssetBundle($name)
      {
          if (($bundle = $this->getAssetBundleFromView($name)) === false) {
              return $bundle;
          }
  
          $config = $this->getConfig();
  
          if (!($module = $config->getModule($name))) {
              $module = $config->addModule($name);
          }
  
          $options = $bundle->jsOptions;
  
          if (!isset($options['position'])) {
              $options['position'] = View::POS_END;
          }
  
          $options['baseUrl'] = $bundle->baseUrl;
  
          $module->setOptions($options);
  
          // TODO: think about optimization
          foreach ($bundle->depends as $dependency) {
              if (($dependency = $this->registerAssetBundle($dependency)) !== false) {
                  $module->addDependency($dependency);
              }
          }
  
          $this->importJsFilesFromBundle($bundle, $module);
  
          return $module;
      }
code_tokens: public function registerAssetBundle ( $ name ) { if ( ( $ bundle = $ this -> getAssetBundleFromView ( $ name ) ) === false ) { return $ bundle ; } $ config = $ this -> getConfig ( ) ; if ( ! ( $ module = $ config -> getModule ( $ name ) ) ) { $ module = $ config -> addModule ( $ name ) ; } $ options = $ bundle -> jsOptions ; if ( ! isset ( $ options [ 'position' ] ) ) { $ options [ 'position' ] = View :: POS_END ; } $ options [ 'baseUrl' ] = $ bundle -> baseUrl ; $ module -> setOptions ( $ options ) ; // TODO: think about optimization foreach ( $ bundle -> depends as $ dependency ) { if ( ( $ dependency = $ this -> registerAssetBundle ( $ dependency ) ) !== false ) { $ module -> addDependency ( $ dependency ) ; } } $ this -> importJsFilesFromBundle ( $ bundle , $ module ) ; return $ module ; }
docstring: Registers asset bundle in the loader
  
  @param string $name
  
  @return ModuleInterface|false an instance of registered module or false if asset bundle was not registered
docstring_tokens: Registers asset bundle in the loader