| 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); |
||
| 41 | 4 | public function bake($action, $content = '') |
|
| 42 | { |
||
| 43 | 4 | if ($content === true) { |
|
| 44 | 4 | $content = $this->getContent($action); |
|
| 45 | } |
||
| 46 | 4 | if (empty($content)) { |
|
| 47 | $this->err("<warning>No generated content for '{$action}.ctp', not generating template.</warning>"); |
||
| 48 | |||
| 49 | return false; |
||
| 50 | } |
||
| 51 | 4 | $this->out("\n" . sprintf('Baking `%s` view twig template file...', $action), 1, Shell::QUIET); |
|
| 52 | 4 | $path = $this->getPath(); |
|
| 53 | 4 | $filename = $path . Inflector::underscore($action) . '.twig'; |
|
| 54 | 4 | $this->createFile($filename, $content); |
|
| 55 | |||
| 56 | 4 | return $content; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |