| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | protected function renderTemplate(ResourceInterface $resource, $filepath) |
||
| 18 | { |
||
| 19 | $values = array( |
||
| 20 | '%filepath%' => $filepath, |
||
| 21 | '%name%' => $resource->getName(), |
||
| 22 | '%extends%' => $this->getParentClass(), |
||
| 23 | '%namespace%' => $resource->getSrcNamespace(), |
||
| 24 | '%namespace_block%' => '' !== $resource->getSrcNamespace() |
||
| 25 | ? sprintf("\n\nnamespace %s;", $resource->getSrcNamespace()) |
||
| 26 | : '', |
||
| 27 | ); |
||
| 28 | |||
| 29 | if (!$content = $this->getTemplateRenderer()->render($this->getTemplateName(), $values)) { |
||
| 30 | $content = $this->getTemplateRenderer()->renderString( |
||
| 31 | file_get_contents(__DIR__ . $this->getTemplateFile()), $values |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | return $content; |
||
| 36 | } |
||
| 37 | |||
| 56 |