original_string: public function types()
      {
          if ($this->types === null) {
              $this->types = [];
  
              $grav = Grav::instance();
  
              /** @var UniformResourceLocator $locator */
              $locator = $grav['locator'];
  
              // Get stream / directory iterator.
              if ($locator->isStream($this->search)) {
                  $iterator = $locator->getIterator($this->search);
              } else {
                  $iterator = new \DirectoryIterator($this->search);
              }
  
              /** @var \DirectoryIterator $file */
              foreach ($iterator as $file) {
                  if (!$file->isFile() || '.' . $file->getExtension() !== YAML_EXT) {
                      continue;
                  }
                  $name = $file->getBasename(YAML_EXT);
                  $this->types[$name] = ucfirst(str_replace('_', ' ', $name));
              }
          }
  
          return $this->types;
      }
code: public function types()
      {
          if ($this->types === null) {
              $this->types = [];
  
              $grav = Grav::instance();
  
              /** @var UniformResourceLocator $locator */
              $locator = $grav['locator'];
  
              // Get stream / directory iterator.
              if ($locator->isStream($this->search)) {
                  $iterator = $locator->getIterator($this->search);
              } else {
                  $iterator = new \DirectoryIterator($this->search);
              }
  
              /** @var \DirectoryIterator $file */
              foreach ($iterator as $file) {
                  if (!$file->isFile() || '.' . $file->getExtension() !== YAML_EXT) {
                      continue;
                  }
                  $name = $file->getBasename(YAML_EXT);
                  $this->types[$name] = ucfirst(str_replace('_', ' ', $name));
              }
          }
  
          return $this->types;
      }
code_tokens: public function types ( ) { if ( $ this -> types === null ) { $ this -> types = [ ] ; $ grav = Grav :: instance ( ) ; /** @var UniformResourceLocator $locator */ $ locator = $ grav [ 'locator' ] ; // Get stream / directory iterator. if ( $ locator -> isStream ( $ this -> search ) ) { $ iterator = $ locator -> getIterator ( $ this -> search ) ; } else { $ iterator = new \ DirectoryIterator ( $ this -> search ) ; } /** @var \DirectoryIterator $file */ foreach ( $ iterator as $ file ) { if ( ! $ file -> isFile ( ) || '.' . $ file -> getExtension ( ) !== YAML_EXT ) { continue ; } $ name = $ file -> getBasename ( YAML_EXT ) ; $ this -> types [ $ name ] = ucfirst ( str_replace ( '_' , ' ' , $ name ) ) ; } } return $ this -> types ; }
docstring: Get all available blueprint types.
  
  @return  array  List of type=>name
docstring_tokens: Get all available blueprint types .