pathExists() public method

public pathExists ( string $path ) : boolean
$path string
return boolean
 /**
  * @param string $name
  * @param array  $values
  *
  * @return string
  */
 public function render($name, array $values = array())
 {
     foreach ($this->locations as $location) {
         $path = $location . DIRECTORY_SEPARATOR . $this->normalizeLocation($name, true) . '.tpl';
         if ($this->filesystem->pathExists($path)) {
             return $this->renderString($this->filesystem->getFileContents($path), $values);
         }
     }
 }
Esempio n. 2
0
 /**
  * @param string $query
  *
  * @return string
  */
 private function getQueryPath($query)
 {
     $sepr = DIRECTORY_SEPARATOR;
     $replacedQuery = str_replace(array('\\', '/'), $sepr, $query);
     if ($this->queryContainsQualifiedClassName($query)) {
         $namespacedQuery = null === $this->psr4Prefix ? $replacedQuery : substr($replacedQuery, strlen($this->srcNamespace));
         $path = $this->fullSpecPath . $namespacedQuery . 'Spec.php';
         if ($this->filesystem->pathExists($path)) {
             return $path;
         }
     }
     return rtrim(realpath($replacedQuery), $sepr);
 }
Esempio n. 3
0
 /**
  * @param string $path
  *
  * @return PSR0Resource[]
  */
 protected function findSpecResources($path)
 {
     if (!$this->filesystem->pathExists($path)) {
         return array();
     }
     if ('.php' === substr($path, -4)) {
         return array($this->createResourceFromSpecFile(realpath($path)));
     }
     $resources = array();
     foreach ($this->filesystem->findSpecFilesIn($path) as $file) {
         $resources[] = $this->createResourceFromSpecFile($file->getRealPath());
     }
     return $resources;
 }
Esempio n. 4
0
 /**
  * @param string $filepath
  *
  * @return bool
  */
 private function ifFileAlreadyExists($filepath)
 {
     return $this->filesystem->pathExists($filepath);
 }
Esempio n. 5
0
 private function moduleFileExists()
 {
     return $this->filesystem->pathExists($this->getFilePath());
 }
 /**
  * @param string $filePath
  * @return bool
  */
 private function fileExists($filePath)
 {
     return $this->filesystem->pathExists($filePath);
 }
Esempio n. 7
0
 private function moduleFileExists($moduleName)
 {
     return $this->fileSystem->pathExists($this->getFilePath($moduleName));
 }