for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* components
*
* @author Wolfy-J
*/
namespace Spiral\Stempler;
* Default implementation for ContextInterface.
final class StemplerSource
{
* Must be local stream.
* @var string
private $filename;
* @var null|string
private $source = null;
* @param string $filename
* @param string $code
public function __construct(string $filename, string $code = null)
$this->filename = $filename;
$this->source = $code;
}
* {@inheritdoc}
public function getFilename(): string
return $this->filename;
public function getCode(): string
return $this->source ?? file_get_contents($this->filename);