Code Duplication    Length = 19-19 lines in 2 locations

src/system/RoutesModule/Controller/Base/AbstractRouteController.php 2 locations

@@ 469-487 (lines=19) @@
466
    /**
467
     * This method includes the common implementation code for adminReload() and reload().
468
     */
469
    protected function reloadInternal(Request $request, $isAdmin = false)
470
    {
471
        $controllerHelper = $this->get('zikula_routes_module.controller_helper');
472
473
        // parameter specifying which type of objects we are treating
474
        $objectType = 'route';
475
        $permLevel = $isAdmin ? ACCESS_ADMIN : ACCESS_OVERVIEW;
476
        if (!$this->hasPermission($this->name . ':' . ucfirst($objectType) . ':', '::', $permLevel)) {
477
            throw new AccessDeniedException();
478
        }
479
        /** TODO: custom logic */
480
481
        $templateParameters = [
482
            'routeArea' => $isAdmin ? 'admin' : ''
483
        ];
484
485
        // return template
486
        return $this->render('@ZikulaRoutesModule/Route/reload.html.twig', $templateParameters);
487
    }
488
    /**
489
     * This is a custom action in the admin area.
490
     *
@@ 519-537 (lines=19) @@
516
    /**
517
     * This method includes the common implementation code for adminRenew() and renew().
518
     */
519
    protected function renewInternal(Request $request, $isAdmin = false)
520
    {
521
        $controllerHelper = $this->get('zikula_routes_module.controller_helper');
522
523
        // parameter specifying which type of objects we are treating
524
        $objectType = 'route';
525
        $permLevel = $isAdmin ? ACCESS_ADMIN : ACCESS_OVERVIEW;
526
        if (!$this->hasPermission($this->name . ':' . ucfirst($objectType) . ':', '::', $permLevel)) {
527
            throw new AccessDeniedException();
528
        }
529
        /** TODO: custom logic */
530
531
        $templateParameters = [
532
            'routeArea' => $isAdmin ? 'admin' : ''
533
        ];
534
535
        // return template
536
        return $this->render('@ZikulaRoutesModule/Route/renew.html.twig', $templateParameters);
537
    }
538
539
    /**
540
     * Process status changes for multiple items.