Code Duplication    Length = 6-10 lines in 2 locations

src/Psalm/Config/FileFilter.php 2 locations

@@ 167-176 (lines=10) @@
164
165
                $directory_path = realpath($prospective_directory_path);
166
167
                if (!$directory_path) {
168
                    if ($allow_missing_files) {
169
                        continue;
170
                    }
171
172
                    throw new ConfigException(
173
                        'Could not resolve config path to ' . $base_dir
174
                            . DIRECTORY_SEPARATOR . (string)$directory['name']
175
                    );
176
                }
177
178
                if (!is_dir($directory_path)) {
179
                    throw new ConfigException(
@@ 178-183 (lines=6) @@
175
                    );
176
                }
177
178
                if (!is_dir($directory_path)) {
179
                    throw new ConfigException(
180
                        $base_dir . DIRECTORY_SEPARATOR . (string)$directory['name']
181
                            . ' is not a directory'
182
                    );
183
                }
184
185
                /** @var \RecursiveDirectoryIterator */
186
                $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory_path));