| Conditions | 5 |
| Paths | 16 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5.7874 |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | 4 | public function generate(GenerateableInterface $model) { |
|
| 33 | 4 | $content = "<?php\n"; |
|
| 34 | |||
| 35 | 4 | $comment = $this->config->getHeaderComment(); |
|
| 36 | 4 | if (!empty($comment)) { |
|
| 37 | $docblock = new Docblock(); |
||
| 38 | $docblock->setLongDescription($comment); |
||
| 39 | $content .= str_replace('/**', '/*', $docblock->toString()) . "\n"; |
||
| 40 | } |
||
| 41 | |||
| 42 | 4 | if ($this->config->getHeaderDocblock() instanceof Docblock) { |
|
| 43 | $content .= $this->config->getHeaderDocblock()->toString() . "\n"; |
||
| 44 | } |
||
| 45 | |||
| 46 | 4 | if ($this->config->getDeclareStrictTypes()) { |
|
| 47 | 1 | $content .= "declare(strict_types=1);\n\n"; |
|
| 48 | 1 | } |
|
| 49 | |||
| 50 | 4 | $content .= parent::generate($model); |
|
| 51 | |||
| 52 | 4 | if ($this->config->getBlankLineAtEnd()) { |
|
| 53 | 4 | $content .= "\n"; |
|
| 54 | 4 | } |
|
| 55 | |||
| 56 | 4 | return $content; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |