original_string: public function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue)
      {
          if ($file->getExtension() != 'yml') {
              return;
          }
          $path = strtr($file->getRealPath(), DIRECTORY_SEPARATOR, '/');
          if (strpos($path, 'Resources/config/pageparts') === false) {
              return;
          }
          $parser = $this->getYmlParser();
          $pagePartConfigs = $parser->parse(file_get_contents($file));
          if (array_key_exists('types', $pagePartConfigs) && is_array($pagePartConfigs['types'])) {
              foreach ($pagePartConfigs['types'] as $type) {
                  if (is_array($type) && array_key_exists('name', $type)) {
                      $message = new Message($type['name']);
                      $message->addSource(new FileSource((string)$file));
                      $catalogue->add($message);
                  }
              }
          }
      }
code: public function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue)
      {
          if ($file->getExtension() != 'yml') {
              return;
          }
          $path = strtr($file->getRealPath(), DIRECTORY_SEPARATOR, '/');
          if (strpos($path, 'Resources/config/pageparts') === false) {
              return;
          }
          $parser = $this->getYmlParser();
          $pagePartConfigs = $parser->parse(file_get_contents($file));
          if (array_key_exists('types', $pagePartConfigs) && is_array($pagePartConfigs['types'])) {
              foreach ($pagePartConfigs['types'] as $type) {
                  if (is_array($type) && array_key_exists('name', $type)) {
                      $message = new Message($type['name']);
                      $message->addSource(new FileSource((string)$file));
                      $catalogue->add($message);
                  }
              }
          }
      }
code_tokens: public function visitFile ( \ SplFileInfo $ file , MessageCatalogue $ catalogue ) { if ( $ file -> getExtension ( ) != 'yml' ) { return ; } $ path = strtr ( $ file -> getRealPath ( ) , DIRECTORY_SEPARATOR , '/' ) ; if ( strpos ( $ path , 'Resources/config/pageparts' ) === false ) { return ; } $ parser = $ this -> getYmlParser ( ) ; $ pagePartConfigs = $ parser -> parse ( file_get_contents ( $ file ) ) ; if ( array_key_exists ( 'types' , $ pagePartConfigs ) && is_array ( $ pagePartConfigs [ 'types' ] ) ) { foreach ( $ pagePartConfigs [ 'types' ] as $ type ) { if ( is_array ( $ type ) && array_key_exists ( 'name' , $ type ) ) { $ message = new Message ( $ type [ 'name' ] ) ; $ message -> addSource ( new FileSource ( ( string ) $ file ) ) ; $ catalogue -> add ( $ message ) ; } } } }
docstring: Collect the pagepart names!
  
  @param \SplFileInfo $file
  @param MessageCatalogue $catalogue
docstring_tokens: Collect the pagepart names!