original_string: protected static function addLocalConfiguration($componentDirectory, array $component)
      {
          $component['local']   = [];
          $componentDirectories = [];
          for ($dir = 0; $dir < count($component['path']); ++$dir) {
              $componentDirectory = $componentDirectories[] = dirname($componentDirectory);
          }
  
          foreach (array_reverse($componentDirectories) as $componentDirectory) {
              $component['local'][] = self::getLocalConfiguration($componentDirectory);
          }
  
          return $component;
      }
code: protected static function addLocalConfiguration($componentDirectory, array $component)
      {
          $component['local']   = [];
          $componentDirectories = [];
          for ($dir = 0; $dir < count($component['path']); ++$dir) {
              $componentDirectory = $componentDirectories[] = dirname($componentDirectory);
          }
  
          foreach (array_reverse($componentDirectories) as $componentDirectory) {
              $component['local'][] = self::getLocalConfiguration($componentDirectory);
          }
  
          return $component;
      }
code_tokens: protected static function addLocalConfiguration ( $ componentDirectory , array $ component ) { $ component [ 'local' ] = [ ] ; $ componentDirectories = [ ] ; for ( $ dir = 0 ; $ dir < count ( $ component [ 'path' ] ) ; ++ $ dir ) { $ componentDirectory = $ componentDirectories [ ] = dirname ( $ componentDirectory ) ; } foreach ( array_reverse ( $ componentDirectories ) as $ componentDirectory ) { $ component [ 'local' ] [ ] = self :: getLocalConfiguration ( $ componentDirectory ) ; } return $ component ; }
docstring: Amend the directory specific local configuration
  
  @param string $componentDirectory Component directory
  @param array $component           Component
  
  @return array Amended component
docstring_tokens: Amend the directory specific local configuration