Code Duplication    Length = 18-18 lines in 2 locations

src/Webcook/Cms/CoreBundle/Controller/MenuContentProviderSettingsController.php 1 location

@@ 73-90 (lines=18) @@
70
     * )
71
     * @Post("/content-providers/menu/settings", options={"i18n"=false})
72
     */
73
    public function postMenuContentProviderSettingsAction()
74
    {
75
        $this->checkPermission(WebcookCmsVoter::ACTION_INSERT);
76
77
        $response = $this->processSettingsForm(new MenuContentProviderSettings(), 'POST');
78
79
        if ($response instanceof MenuContentProviderSettings) {
80
            $statusCode = 200;
81
            $message = 'Settings has been added.';
82
        } else {
83
            $statusCode = 400;
84
            $message = 'Error while adding new settings.';
85
        }
86
87
        $view = $this->getViewWithMessage($response, $statusCode, $message);
88
89
        return $this->handleView($view);
90
    }
91
92
    /**
93
     * Update settings.

src/Webcook/Cms/CoreBundle/Controller/PageController.php 1 location

@@ 82-99 (lines=18) @@
79
     * )
80
     * @Post(options={"i18n"=false})
81
     */
82
    public function postPagesAction()
83
    {
84
        $this->checkPermission(WebcookCmsVoter::ACTION_INSERT);
85
86
        $response = $this->processPageForm(new Page(), 'POST');
87
88
        if ($response instanceof Page) {
89
            $statusCode = 200;
90
            $message = 'Page has been added.';
91
        } else {
92
            $statusCode = 400;
93
            $message = 'Error while adding new Page.';
94
        }
95
96
        $view = $this->getViewWithMessage($response, $statusCode, $message);
97
98
        return $this->handleView($view);
99
    }
100
101
    /**
102
     * Update Page.