Code Duplication    Length = 6-6 lines in 3 locations

src/system/ExtensionsModule/Helper/BundleSyncHelper.php 3 locations

@@ 202-207 (lines=6) @@
199
200
        // check for duplicate names, display names or urls
201
        foreach ($extensions as $dir => $modInfo) {
202
            if (isset($modulenames[strtolower($modInfo['name'])])) {
203
                throw new FatalErrorException($this->translator->__f('Fatal Error: Two extensions share the same name. [%ext1%] and [%ext2%]', [
204
                    '%ext1%' => $modInfo['name'],
205
                    '%ext2%' => $modulenames[strtolower($modInfo['name'])]
206
                ]));
207
            }
208
209
            if (isset($displaynames[strtolower($modInfo['displayname'])])) {
210
                throw new FatalErrorException($this->translator->__f('Fatal Error: Two extensions share the same displayname. [%ext1%] and [%ext2%]', [
@@ 209-214 (lines=6) @@
206
                ]));
207
            }
208
209
            if (isset($displaynames[strtolower($modInfo['displayname'])])) {
210
                throw new FatalErrorException($this->translator->__f('Fatal Error: Two extensions share the same displayname. [%ext1%] and [%ext2%]', [
211
                    '%ext1%' => $modInfo['name'],
212
                    '%ext2%' => $modulenames[strtolower($modInfo['name'])]
213
                ]));
214
            }
215
216
            if (isset($urls[strtolower($modInfo['url'])])) {
217
                throw new FatalErrorException($this->translator->__f('Fatal Error: Two extensions share the same url. [%ext1%] and [%ext2%]', [
@@ 216-221 (lines=6) @@
213
                ]));
214
            }
215
216
            if (isset($urls[strtolower($modInfo['url'])])) {
217
                throw new FatalErrorException($this->translator->__f('Fatal Error: Two extensions share the same url. [%ext1%] and [%ext2%]', [
218
                    '%ext1%' => $modInfo['name'],
219
                    '%ext2%' => $modulenames[strtolower($modInfo['name'])]
220
                ]));
221
            }
222
223
            $modulenames[strtolower($modInfo['name'])] = $dir;
224
            $displaynames[strtolower($modInfo['displayname'])] = $dir;