Code Duplication    Length = 10-13 lines in 2 locations

src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php 2 locations

@@ 138-147 (lines=10) @@
135
136
        $locale = $this->locale;
137
        $acl = $this->authorizationChecker;
138
        $itemRoute = function (EntityInterface $item) use ($locale, $acl) {
139
            if ($acl->isGranted(PermissionMap::PERMISSION_VIEW, $item->getNode())) {
140
                return array(
141
                    'path' => '_slug_preview',
142
                    'params' => ['_locale' => $locale, 'url' => $item->getUrl()],
143
                );
144
            }
145
146
            return null;
147
        };
148
149
        $nodeAdminListConfigurator->addSimpleItemAction('action.preview', $itemRoute, 'eye');
150
        $nodeAdminListConfigurator->addListAction(
@@ 502-514 (lines=13) @@
499
500
        $nodeAdminListConfigurator->addSimpleItemAction(
501
            'action.undo_delete',
502
            function (EntityInterface $item) use ($locale, $acl) {
503
                if ($acl->isGranted(PermissionMap::PERMISSION_DELETE, $item->getNode())) {
504
                    return [
505
                        'path' => 'KunstmaanNodeBundle_nodes_delete_undo',
506
                        'params' => [
507
                            '_locale' => $locale,
508
                            'id' => $item->getNode()->getId()
509
                        ],
510
                    ];
511
                }
512
513
                return null;
514
            },
515
            'undo'
516
        );
517