| 1 | <?php |
||
| 13 | class TwitalResource implements ResourceInterface |
||
| 14 | { |
||
| 15 | |||
| 16 | private $loader; |
||
| 17 | |||
| 18 | private $resource; |
||
| 19 | |||
| 20 | 1 | public function __construct(TwitalLoader $loader, ResourceInterface $resource) |
|
| 25 | |||
| 26 | 1 | public function getContent() |
|
| 27 | { |
||
| 28 | 1 | $source = $this->resource->getContent(); |
|
| 29 | |||
| 30 | 1 | if ($adapter = $this->loader->getSourceAdapter(strval($this->resource))) { |
|
| 31 | $source = $this->loader->getTwital()->compile($adapter, $source); |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | return $source; |
|
| 35 | } |
||
| 36 | |||
| 37 | public function isFresh($timestamp) |
||
| 41 | |||
| 42 | 1 | public function __toString() |
|
| 46 | } |
||
| 47 |