Code Duplication    Length = 3-3 lines in 2 locations

src/system/ExtensionsModule/Helper/ExtensionHelper.php 2 locations

@@ 110-112 (lines=3) @@
107
                throw new \RuntimeException($this->translator->__f('Error! Not allowed to upgrade %s.', ['%s' => $extension->getDisplayname()]));
108
                break;
109
            default:
110
                if ($extension->getState() > 10) {
111
                    throw new \RuntimeException($this->translator->__f('Error! %s is not compatible with this version of Zikula.', ['%s' => $extension->getDisplayname()]));
112
                }
113
        }
114
115
        if ($extension->getType() == self::TYPE_SYSTEM) {
@@ 167-169 (lines=3) @@
164
            || ($extension->getType() == self::TYPE_SYSTEM && $extension->getName() != 'ZikulaPageLockModule')) {
165
            throw new \RuntimeException($this->translator->__f('Error! No permission to uninstall %s.', ['%s' => $extension->getDisplayname()]));
166
        }
167
        if ($extension->getState() == ExtensionApi::STATE_UNINITIALISED) {
168
            throw new \RuntimeException($this->translator->__f('Error! %s is not yet installed, therefore it cannot be uninstalled.', ['%s' => $extension->getDisplayname()]));
169
        }
170
171
        // allow event to prevent extension removal
172
        $vetoEvent = new GenericEvent($extension);