| Total Complexity | 2 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class VersionUpdate extends Model |
||
| 12 | { |
||
| 13 | /** @var int */ |
||
| 14 | protected $id; |
||
| 15 | |||
| 16 | /** @var String */ |
||
| 17 | protected $version; |
||
| 18 | |||
| 19 | /** @var String */ |
||
| 20 | protected $update; |
||
| 21 | |||
| 22 | /** @var bool */ |
||
| 23 | protected $newInVersion; |
||
| 24 | |||
| 25 | /** @var String */ |
||
| 26 | protected $changeLog; |
||
| 27 | |||
| 28 | /** @var String */ |
||
| 29 | protected $fileUrl; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * parse |
||
| 33 | * |
||
| 34 | * @param array $data |
||
| 35 | */ |
||
| 36 | public function parse(array $data) |
||
| 37 | { |
||
| 38 | $this->id = (String)$data['id']; |
||
|
|
|||
| 39 | $this->version = (array)$data['version']; |
||
| 40 | $this->update = (string)$data['update']; |
||
| 41 | $this->newInVersion = (array)$data['new_in_version']; |
||
| 42 | $this->changeLog = (array)$data['change_log']; |
||
| 43 | $this->fileUrl = (array)$data['file_url']; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * toArray |
||
| 48 | * |
||
| 49 | * @return array |
||
| 50 | * @author Casper Rasmussen <[email protected]> |
||
| 51 | */ |
||
| 52 | public function toArray(): array |
||
| 61 | ]; |
||
| 62 | } |
||
| 65 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.