| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.054 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 39 | 4 | public function bake($action, $content = ''): string |
|
| 40 | { |
||
| 41 | 4 | if ($content === true) { |
|
| 42 | 4 | $content = $this->getContent($action); |
|
| 43 | } |
||
| 44 | 4 | if (empty($content)) { |
|
| 45 | $this->err("<warning>No generated content for '{$action}.ctp', not generating template.</warning>"); |
||
| 46 | |||
| 47 | return false; |
||
| 48 | } |
||
| 49 | 4 | $this->out("\n" . sprintf('Baking `%s` view twig template file...', $action), 1, Shell::QUIET); |
|
| 50 | 4 | $path = $this->getPath(); |
|
| 51 | 4 | $filename = $path . Inflector::underscore($action) . '.twig'; |
|
| 52 | 4 | $this->createFile($filename, $content); |
|
| 53 | |||
| 54 | 4 | return $content; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |