Code Duplication    Length = 4-4 lines in 2 locations

src/Kunstmaan/PagePartBundle/Helper/Services/PagePartCreatorService.php 1 location

@@ 100-103 (lines=4) @@
97
        $page = $translation->getRef($this->em);
98
99
        // Find latest position.
100
        if (\is_null($position)) {
101
            $pageParts = $this->pagePartRepo->getPagePartRefs($page, $context);
102
            $position = \count($pageParts) + 1;
103
        }
104
105
        $this->em->persist($pagePart);
106
        $this->em->flush();

src/Kunstmaan/FixturesBundle/Builder/PagePartBuilder.php 1 location

@@ 84-87 (lines=4) @@
81
            // Find latest position.
82
            $position = array_key_exists('position', $params) ? $params['position'] : null;
83
            $context = isset($params['context']) ? $params['context'] : 'main';
84
            if (is_null($position)) {
85
                $pageParts = $this->pagePartRepo->getPagePartRefs($page, $context);
86
                $position = count($pageParts) + 1;
87
            }
88
89
            $this->pagePartRepo->addPagePart($page, $pp, $position, $context);
90
            $first = false;