original_string: public function findFirstOccurenceOfFile(string $fileName)
      {
          if (!$this->isDir() || !$this->exists()) {
              return null;
          }
  
          foreach ($this->scanDir() as $file) {
              if ($file->getFileName() === $fileName) {
                  return $file;
              }
  
              if ($file->isDir()) {
                  $result = $file->findFirstOccurenceOfFile($fileName);
                  if ($result !== null) {
                      return $result;
                  }
              }
          }
          return null;
      }
code: public function findFirstOccurenceOfFile(string $fileName)
      {
          if (!$this->isDir() || !$this->exists()) {
              return null;
          }
  
          foreach ($this->scanDir() as $file) {
              if ($file->getFileName() === $fileName) {
                  return $file;
              }
  
              if ($file->isDir()) {
                  $result = $file->findFirstOccurenceOfFile($fileName);
                  if ($result !== null) {
                      return $result;
                  }
              }
          }
          return null;
      }
code_tokens: public function findFirstOccurenceOfFile ( string $ fileName ) { if ( ! $ this -> isDir ( ) || ! $ this -> exists ( ) ) { return null ; } foreach ( $ this -> scanDir ( ) as $ file ) { if ( $ file -> getFileName ( ) === $ fileName ) { return $ file ; } if ( $ file -> isDir ( ) ) { $ result = $ file -> findFirstOccurenceOfFile ( $ fileName ) ; if ( $ result !== null ) { return $ result ; } } } return null ; }
docstring: Finds the first occurence of the given filename
  
  @param string $fileName
  
  @return null|File
docstring_tokens: Finds the first occurence of the given filename