Total Complexity | 10 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
15 | class PropertyCollection extends Simple |
||
16 | { |
||
17 | /** |
||
18 | * @param $id |
||
19 | * @return Property|null |
||
20 | */ |
||
21 | public function getById($id) |
||
22 | { |
||
23 | foreach ($this as $property) { |
||
24 | if ($property->id == (string)$id) { |
||
25 | return $property; |
||
26 | } |
||
27 | } |
||
28 | return null; |
||
29 | } |
||
30 | |||
31 | protected function loadPropertiesValue() |
||
32 | { |
||
33 | foreach ($this->xml->ЗначенияСвойства as $property) { |
||
34 | $properties = $this->owner->classifier->getProperties(); |
||
35 | $object = clone $properties->getById($property->Ид); |
||
|
|||
36 | $object->productId = (string)$this->xpath('..')[0]->Ид; |
||
37 | $object->init(); |
||
38 | $this->append($object); |
||
39 | } |
||
40 | } |
||
41 | |||
42 | protected function loadProperties() |
||
43 | { |
||
44 | foreach ($this->xml->Свойство as $property) { |
||
45 | $this->append(new Property($this->owner, $property)); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | public function init() |
||
58 | } |
||
59 | } |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.