Code Duplication    Length = 11-12 lines in 3 locations

src/Objects/ObjectBase.php 3 locations

@@ 138-149 (lines=12) @@
135
                    $this->audios[] = new Audio($value);
136
                    break;
137
                case Property::AUDIO_SECURE_URL:
138
                case Property::AUDIO_TYPE:
139
                    if (count($this->audios) > 0) {
140
                        $this->handleAudioAttribute($this->audios[count($this->audios) - 1], $name, $value);
141
                    } elseif ($debug) {
142
                        throw new \UnexpectedValueException(
143
                            sprintf(
144
                                "Found '%s' property but no audio was found before.",
145
                                $name
146
                            )
147
                        );
148
                    }
149
                    break;
150
                case Property::DESCRIPTION:
151
                    if ($this->description === null) {
152
                        $this->description = $value;
@@ 168-179 (lines=12) @@
165
                case Property::IMAGE_SECURE_URL:
166
                case Property::IMAGE_TYPE:
167
                case Property::IMAGE_WIDTH:
168
                case Property::IMAGE_USER_GENERATED:
169
                    if (count($this->images) > 0) {
170
                        $this->handleImageAttribute($this->images[count($this->images) - 1], $name, $value);
171
                    } elseif ($debug) {
172
                        throw new \UnexpectedValueException(
173
                            sprintf(
174
                                "Found '%s' property but no image was found before.",
175
                                $name
176
                            )
177
                        );
178
                    }
179
                    break;
180
                case Property::LOCALE:
181
                    if ($this->locale === null) {
182
                        $this->locale = $value;
@@ 221-231 (lines=11) @@
218
                case Property::VIDEO_HEIGHT:
219
                case Property::VIDEO_SECURE_URL:
220
                case Property::VIDEO_TYPE:
221
                case Property::VIDEO_WIDTH:
222
                    if (count($this->videos) > 0) {
223
                        $this->handleVideoAttribute($this->videos[count($this->videos) - 1], $name, $value);
224
                    } elseif ($debug) {
225
                        throw new \UnexpectedValueException(
226
                            sprintf(
227
                                "Found '%s' property but no video was found before.",
228
                                $name
229
                            )
230
                        );
231
                    }
232
            }
233
        }
234
    }