Code Duplication    Length = 5-7 lines in 3 locations

src/Yandex/Common/Model.php 3 locations

@@ 93-99 (lines=7) @@
90
                $propertyName = $ourPropertyName;
91
            }
92
93
            if (property_exists($this, $propertyName)) {
94
                if (array_key_exists($propertyName, $this->mappingClasses)) {
95
                    $this->{$propertyName} = new $this->mappingClasses[$propertyName]($data->current());
96
                } else {
97
                    $this->{$propertyName} = (string)$data->current();
98
                }
99
            }
100
        }
101
102
        //collect root element
@@ 110-116 (lines=7) @@
107
            $propertyName = $ourPropertyName;
108
        }
109
110
        if (property_exists($this, $propertyName)) {
111
            if (array_key_exists($propertyName, $this->mappingClasses)) {
112
                $this->{$propertyName} = new $this->mappingClasses[$propertyName]($data);
113
            } else {
114
                $this->{$propertyName} = (string)$data;
115
            }
116
        }
117
118
        return $this;
119
    }
@@ 150-154 (lines=5) @@
147
            }
148
149
            if (property_exists($this, $propertyName)) {
150
                if (isset($this->mappingClasses[$propertyName])) {
151
                    $this->{$propertyName} = new $this->mappingClasses[$propertyName]($val);
152
                } else {
153
                    $this->{$propertyName} = $val;
154
                }
155
            }
156
        }
157