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