| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 16 |
| Ratio | 100 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | 8 | View Code Duplication | function __construct($data = NULL) |
| 10 | { |
||
| 11 | 8 | $this->fields = array |
|
| 12 | ( |
||
| 13 | 8 | 'id' => '', |
|
| 14 | 8 | 'current' => NULL, |
|
| 15 | 8 | 'day' => NULL, |
|
| 16 | ); |
||
| 17 | |||
| 18 | 8 | if(!empty($data)) |
|
| 19 | 8 | { |
|
| 20 | 8 | parent::__construct(array('id' => $data['id'])); |
|
| 21 | 8 | $this->fields['current'] = new Current($data['curr']); |
|
| 22 | 8 | $this->fields['day'] = new Day($data['day']); |
|
| 23 | 8 | } |
|
| 24 | } |
||
| 25 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.