| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | abstract class AbstractEngine implements EngineInterface |
||
| 22 | { |
||
| 23 | protected const EXTENSION = ''; |
||
| 24 | |||
| 25 | /** @var string */ |
||
| 26 | protected $extension; |
||
| 27 | |||
| 28 | /** @var LoaderInterface */ |
||
| 29 | protected $loader; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function withLoader(LoaderInterface $loader): EngineInterface |
||
| 35 | { |
||
| 36 | $engine = clone $this; |
||
| 37 | $engine->loader = $loader->withExtension($this->extension ?? static::EXTENSION); |
||
| 38 | |||
| 39 | return $engine; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | public function getLoader(): LoaderInterface |
||
| 52 | } |
||
| 53 | } |
||
| 54 |