| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 39 | static function fromArray($raw) |
||
|
|
|||
| 40 | { |
||
| 41 | $item = new self; |
||
| 42 | |||
| 43 | $item->rawData = $raw; |
||
| 44 | |||
| 45 | $item->productType = $raw['productType']; |
||
| 46 | $item->title = $raw['title']; |
||
| 47 | $item->price = (float)$raw['price']; |
||
| 48 | $item->sellingPrice = (float)$raw['sellingPrice']; |
||
| 49 | |||
| 50 | return $item; |
||
| 51 | } |
||
| 52 | } |
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.