| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 6 | public function resolve(string $name): Template |
|
| 23 | { |
||
| 24 | /** @var \SplFileInfo $path */ |
||
| 25 | 6 | foreach ($this->getPaths() as $path) { |
|
| 26 | 6 | if (file_exists($templateFilePath = $path->getRealPath() . "/{$name}")) { |
|
| 27 | 6 | return new Template(new SplFileObject($templateFilePath), $this); |
|
| 28 | } |
||
| 29 | } |
||
| 30 | 2 | throw new FileNotFoundException("Cannot find the template file named '{$name}'."); |
|
| 31 | } |
||
| 32 | |||
| 49 |