Code Duplication    Length = 6-9 lines in 2 locations

src/Mapper/Json.php 2 locations

@@ 184-189 (lines=6) @@
181
                    $proptype = $proptype;
182
                    $array = self::createInstance($proptype, false, $jsonValue);
183
                }
184
            } elseif (\is_a($type, \ArrayObject::class, true)) {
185
                /** @noinspection PhpSillyAssignmentInspection - phpstan helper */
186
                /** @psalm-var \ArrayObject<mixed, mixed> $type */
187
                $type = $type;
188
                $array = self::createInstance($type, false, $jsonValue);
189
            }
190
191
            if ($array !== null) {
192
                /** @noinspection NotOptimalIfConditionsInspection */
@@ 278-286 (lines=9) @@
275
                throw new \InvalidArgumentException(
276
                    'JSON property "' . ($parent_key ?: '?') . '" is an array of type "' . $class . '" but contained a value of type "' . \gettype($jsonValue) . '"'
277
                );
278
            } elseif (\is_a($class, \ArrayObject::class, true)) {
279
                /** @noinspection PhpSillyAssignmentInspection - phpstan helper */
280
                /** @psalm-var \ArrayObject<mixed, mixed> $class */
281
                $class = $class;
282
                $array[$key] = $this->mapArray(
283
                    $jsonValue,
284
                    self::createInstance($class)
285
                );
286
            } else {
287
                /** @noinspection PhpSillyAssignmentInspection - phpstan helper */
288
                /** @psalm-var class-string $class */
289
                $class = $class;