| Conditions | 4 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 29 | public function setTemplateData(array $templateData) |
||
| 30 | 1 | { |
|
| 31 | 1 | $properties = ''; |
|
| 32 | 1 | if ($templateData['columns']) { |
|
| 33 | 1 | $columns = $templateData['columns']; |
|
| 34 | foreach ($columns as $column) { |
||
| 35 | 1 | // all properties will be `string` except `bigint`, `int`, etc. columns |
|
| 36 | 1 | $columnType = false !== strpos($column['type'], 'int') ? 'integer' : 'string'; |
|
| 37 | $properties .= ' * @property ' . $columnType . ' $' . $column['name'] . "\n"; |
||
| 38 | 1 | } |
|
| 39 | unset($templateData['columns']); |
||
| 40 | 1 | } |
|
| 41 | 1 | $templateData['properties'] = $properties; |
|
| 42 | 1 | $this->templateData = $templateData; |
|
| 43 | } |
||
| 45 |