Code Duplication    Length = 18-18 lines in 2 locations

src/SourceLocator/Type/Composer/Psr/Psr0Mapping.php 1 location

@@ 80-97 (lines=18) @@
77
     *
78
     * @throws InvalidPrefixMapping
79
     */
80
    private static function assertValidMapping(array $mappings) : void
81
    {
82
        foreach ($mappings as $prefix => $paths) {
83
            if ($prefix === '') {
84
                throw InvalidPrefixMapping::emptyPrefixGiven();
85
            }
86
87
            if ($paths === []) {
88
                throw InvalidPrefixMapping::emptyPrefixMappingGiven($prefix);
89
            }
90
91
            foreach ($paths as $path) {
92
                if (! is_dir($path)) {
93
                    throw InvalidPrefixMapping::prefixMappingIsNotADirectory($prefix, $path);
94
                }
95
            }
96
        }
97
    }
98
}
99

src/SourceLocator/Type/Composer/Psr/Psr4Mapping.php 1 location

@@ 101-118 (lines=18) @@
98
     *
99
     * @throws InvalidPrefixMapping
100
     */
101
    private static function assertValidMapping(array $mappings) : void
102
    {
103
        foreach ($mappings as $prefix => $paths) {
104
            if ($prefix === '') {
105
                throw InvalidPrefixMapping::emptyPrefixGiven();
106
            }
107
108
            if ($paths === []) {
109
                throw InvalidPrefixMapping::emptyPrefixMappingGiven($prefix);
110
            }
111
112
            foreach ($paths as $path) {
113
                if (! is_dir($path)) {
114
                    throw InvalidPrefixMapping::prefixMappingIsNotADirectory($prefix, $path);
115
                }
116
            }
117
        }
118
    }
119
}
120