original_string: public function exists(string $path){
      if ( !empty($path) ){
        $dir = dirname($path);
        $ext = \bbn\str::file_ext($path);
        $file = basename($path);
        if ( \is_array($files = $this->listFiles($dir)) ){
          foreach ( $files as $f ){
            if ( $f['basename'] === $file ){
              return true;
            }
          }
        }
      }
      return false;
    }
code: public function exists(string $path){
      if ( !empty($path) ){
        $dir = dirname($path);
        $ext = \bbn\str::file_ext($path);
        $file = basename($path);
        if ( \is_array($files = $this->listFiles($dir)) ){
          foreach ( $files as $f ){
            if ( $f['basename'] === $file ){
              return true;
            }
          }
        }
      }
      return false;
    }
code_tokens: public function exists ( string $ path ) { if ( ! empty ( $ path ) ) { $ dir = dirname ( $ path ) ; $ ext = \ bbn \ str :: file_ext ( $ path ) ; $ file = basename ( $ path ) ; if ( \ is_array ( $ files = $ this -> listFiles ( $ dir ) ) ) { foreach ( $ files as $ f ) { if ( $ f [ 'basename' ] === $ file ) { return true ; } } } } return false ; }
docstring: Checks if a file is present in a folder on the server
  
  @param string $path The file or dir relative or full path
  @return bool
docstring_tokens: Checks if a file is present in a folder on the server