HippoPHP\Hippo\FileSystem::getContent PHP Method

getContent() public method

public getContent ( string $path ) : string
$path string
return string
    public function getContent($path)
    {
        if (!file_exists($path)) {
            throw new FileNotFoundException($path);
        }
        if (is_dir($path) || !is_readable($path)) {
            throw new FileNotReadableException($path);
        }
        return file_get_contents($path);
    }

Usage Example

Esempio n. 1
0
 /**
  * @param string $path
  *
  * @return \HippoPHP\Hippo\CheckResult[]
  */
 protected function checkPathFile($path)
 {
     $file = new File($path, $this->fileSystem->getContent($path));
     $checkResults = $this->checkFile($file);
     if ($this->observer !== null) {
         call_user_func($this->observer, $file, $checkResults);
     }
     return $checkResults;
 }