| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | abstract class StaticModel extends Model |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return array |
||
| 17 | */ |
||
| 18 | public abstract function modelsAttributes(); |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return static[] |
||
| 22 | */ |
||
| 23 | public function models() { |
||
| 24 | $models = []; |
||
| 25 | foreach ($this->modelsAttributes() as $key => $attributes) { |
||
| 26 | $models[$key] = new static($attributes); |
||
| 27 | } |
||
| 28 | return $models; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $key |
||
| 33 | * @return static |
||
| 34 | */ |
||
| 35 | public function findByKey($key) { |
||
| 41 | } |
||
| 42 | |||
| 43 | } |