fileName = $fileName; $this->statProps = $statProps; } /** * Get the Source key (used to generate the compiled class name). * * @throws RuntimeException when a source file cannot be read * * @return string */ public function getKey() { $chunks = array( 'fileName' => $this->fileName, ); if (!empty($this->statProps)) { if (!isset($this->stat)) { $this->stat = @stat($this->fileName); } if ($this->stat === false) { throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName)); } foreach ($this->statProps as $prop) { $chunks[$prop] = $this->stat[$prop]; } } return json_encode($chunks); } /** * Get the template Source. * * @return string */ public function getSource() { return file_get_contents($this->fileName); } }