Conditions | 4 |
Paths | 8 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
45 | static function getCity($cart) { |
||
46 | $fieldInfo = \Ecommerce\UserAdds\Field::get('deliveryfield_city', 'code'); |
||
47 | $field = \Ecommerce\Delivery\Field::get('city', 'code'); |
||
48 | $cityItem = null; |
||
49 | if (isset($cart->infos[$fieldInfo->id])) { |
||
50 | $itemId = $cart->infos[$fieldInfo->id]->value; |
||
51 | } |
||
52 | if (isset($cart->deliveryInfos[$field->id])) { |
||
53 | $itemId = $cart->deliveryInfos[$field->id]->value; |
||
54 | } |
||
55 | if (!empty($itemId)) { |
||
56 | return \Ecommerce\Delivery\Field\Item::get([['id', $itemId], ['delivery_field_id', $field->id]]); |
||
57 | } |
||
58 | return false; |
||
59 | } |
||
60 | } |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.