original_string: private function deleteDirectoryTree($directory)
      {
          $filePaths = scandir($directory);
  
          foreach ($filePaths as $filePath) {
              if ($filePath == '.' || $filePath == '..') {
                  continue;
              }
  
              $fullFilePath = $directory.'/'.$filePath;
              if (is_dir($fullFilePath)) {
                  $result = $this->deleteDirectoryTree($fullFilePath);
                  if ($result) {
                      $result = rmdir($fullFilePath);
                  }
              } else {
                  if (basename($fullFilePath) == '.keep') {
                      continue;
                  }
                  $result = unlink($fullFilePath);
              }
  
              if (!$result) {
                  return false;
              }
          }
  
          return true;
      }
code: private function deleteDirectoryTree($directory)
      {
          $filePaths = scandir($directory);
  
          foreach ($filePaths as $filePath) {
              if ($filePath == '.' || $filePath == '..') {
                  continue;
              }
  
              $fullFilePath = $directory.'/'.$filePath;
              if (is_dir($fullFilePath)) {
                  $result = $this->deleteDirectoryTree($fullFilePath);
                  if ($result) {
                      $result = rmdir($fullFilePath);
                  }
              } else {
                  if (basename($fullFilePath) == '.keep') {
                      continue;
                  }
                  $result = unlink($fullFilePath);
              }
  
              if (!$result) {
                  return false;
              }
          }
  
          return true;
      }
code_tokens: private function deleteDirectoryTree ( $ directory ) { $ filePaths = scandir ( $ directory ) ; foreach ( $ filePaths as $ filePath ) { if ( $ filePath == '.' || $ filePath == '..' ) { continue ; } $ fullFilePath = $ directory . '/' . $ filePath ; if ( is_dir ( $ fullFilePath ) ) { $ result = $ this -> deleteDirectoryTree ( $ fullFilePath ) ; if ( $ result ) { $ result = rmdir ( $ fullFilePath ) ; } } else { if ( basename ( $ fullFilePath ) == '.keep' ) { continue ; } $ result = unlink ( $ fullFilePath ) ; } if ( ! $ result ) { return false ; } } return true ; }
docstring: Removes cache files from a given directory.
  
  @param string $directory
  
  @return bool
docstring_tokens: Removes cache files from a given directory .