original_string: protected function appendRequiredPlugins(array $plugins, array $result)
      {
          foreach ((array) array_get($result, 'require') as $plugin) {
              if (
                  ($name = array_get($plugin, 'code')) &&
                  ($hash = array_get($plugin, 'hash')) &&
                  !PluginManager::instance()->hasPlugin($name)
              ) {
                  $plugins[$name] = $hash;
              }
          }
  
          return $plugins;
      }
code: protected function appendRequiredPlugins(array $plugins, array $result)
      {
          foreach ((array) array_get($result, 'require') as $plugin) {
              if (
                  ($name = array_get($plugin, 'code')) &&
                  ($hash = array_get($plugin, 'hash')) &&
                  !PluginManager::instance()->hasPlugin($name)
              ) {
                  $plugins[$name] = $hash;
              }
          }
  
          return $plugins;
      }
code_tokens: protected function appendRequiredPlugins ( array $ plugins , array $ result ) { foreach ( ( array ) array_get ( $ result , 'require' ) as $ plugin ) { if ( ( $ name = array_get ( $ plugin , 'code' ) ) && ( $ hash = array_get ( $ plugin , 'hash' ) ) && ! PluginManager :: instance ( ) -> hasPlugin ( $ name ) ) { $ plugins [ $ name ] = $ hash ; } } return $ plugins ; }
docstring: Adds require plugin codes to the collection based on a result.
  @param array $plugins
  @param array $result
  @return array
docstring_tokens: Adds require plugin codes to the collection based on a result .