Code Duplication    Length = 7-7 lines in 2 locations

Controller/AdminBlockController.php 1 location

@@ 49-55 (lines=7) @@
46
            $className = $this->_blockDefaultClass;
47
        }
48
49
        if ($content !== null) {
50
            $instanceAdmin = $this->admin->getConfigurationPool()->getAdminByClass($className);
51
52
            if ($instanceAdmin !== null) {
53
                return $this->redirect($instanceAdmin->generateUrl('edit', ['id' => $content->getId()]));
54
            }
55
        }
56
57
        throw new NotFoundHttpException(sprintf('unable to find a class admin for the %s class', get_class($content)));
58
    }

Controller/AdminNodeController.php 1 location

@@ 22-28 (lines=7) @@
19
20
        $content = $this->findContentFromNode($object);
21
22
        if ($content !== null) {
23
            $instanceAdmin = $this->admin->getConfigurationPool()->getAdminByClass(get_class($content));
24
25
            if ($instanceAdmin !== null) {
26
                return $this->redirect($instanceAdmin->generateUrl('edit', ['id' => $content->getId()]));
27
            }
28
        }
29
30
        throw new NotFoundHttpException(sprintf('unable to find a class admin for the %s class', $contentType['class']));
31
    }