Code Duplication    Length = 7-7 lines in 2 locations

src/HydratorContainer/FallbackHydratorContainer.php 1 location

@@ 50-56 (lines=7) @@
47
        }
48
49
        $interfaces = array_intersect(array_keys($this->interfaces), array_values(class_implements($class)));
50
        if($interfaces) {
51
            if(\count($interfaces) > 1) {
52
                throw HydratorConflictException::fromClass($class, $interfaces);
53
            }
54
55
            return $this->interfaces[array_shift($interfaces)];
56
        }
57
58
        throw HydratorNotFoundException::fromClass($class);
59
    }

src/NormalizerContainer/FallbackNormalizerContainer.php 1 location

@@ 51-57 (lines=7) @@
48
        }
49
50
        $interfaces = array_intersect(array_keys($this->interfaces), array_values(class_implements($class)));
51
        if($interfaces) {
52
            if(\count($interfaces) > 1) {
53
                throw NormalizerConflictException::fromClass($class, $interfaces);
54
            }
55
56
            return $this->interfaces[array_shift($interfaces)];
57
        }
58
59
        if(null === $this->default) {
60
            throw NormalizerNotFoundException::fromClass($class);