original_string: public function mediaDirFunc($media_dir)
      {
          /** @var UniformResourceLocator $locator */
          $locator = $this->grav['locator'];
  
          if ($locator->isStream($media_dir)) {
              $media_dir = $locator->findResource($media_dir);
          }
  
          if ($media_dir && file_exists($media_dir)) {
              return new Media($media_dir);
          }
  
          return null;
      }
code: public function mediaDirFunc($media_dir)
      {
          /** @var UniformResourceLocator $locator */
          $locator = $this->grav['locator'];
  
          if ($locator->isStream($media_dir)) {
              $media_dir = $locator->findResource($media_dir);
          }
  
          if ($media_dir && file_exists($media_dir)) {
              return new Media($media_dir);
          }
  
          return null;
      }
code_tokens: public function mediaDirFunc ( $ media_dir ) { /** @var UniformResourceLocator $locator */ $ locator = $ this -> grav [ 'locator' ] ; if ( $ locator -> isStream ( $ media_dir ) ) { $ media_dir = $ locator -> findResource ( $ media_dir ) ; } if ( $ media_dir && file_exists ( $ media_dir ) ) { return new Media ( $ media_dir ) ; } return null ; }
docstring: Process a folder as Media and return a media object
  
  @param string $media_dir
  @return Media|null
docstring_tokens: Process a folder as Media and return a media object