Code Duplication    Length = 3-7 lines in 2 locations

src/system/RoutesModule/Form/Handler/Common/Base/AbstractEditHandler.php 2 locations

@@ 318-320 (lines=3) @@
315
        $this->templateParameters['mode'] = $hasIdentifier ? 'edit' : 'create';
316
317
        if ($this->templateParameters['mode'] == 'edit') {
318
            if (!$this->permissionApi->hasPermission($this->permissionComponent, $this->createCompositeIdentifier() . '::', ACCESS_EDIT)) {
319
                throw new AccessDeniedException();
320
            }
321
322
            $entity = $this->initEntityForEditing();
323
            if (!is_object($entity)) {
@@ 332-338 (lines=7) @@
329
                $lockName = 'ZikulaRoutesModule' . $this->objectTypeCapital . $this->createCompositeIdentifier();
330
                $this->lockingApi->addLock($lockName, $this->getRedirectUrl(null));
331
            }
332
        } else {
333
            if (!$this->permissionApi->hasPermission($this->permissionComponent, '::', ACCESS_EDIT)) {
334
                throw new AccessDeniedException();
335
            }
336
337
            $entity = $this->initEntityForCreation();
338
        }
339
340
        // save entity reference for later reuse
341
        $this->entityRef = $entity;