SystemController::edit()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
1
<?php namespace Anomaly\PreferencesModule\Http\Controller\Admin;
2
3
use Anomaly\PreferencesModule\Preference\Form\PreferenceFormBuilder;
4
use Anomaly\Streams\Platform\Http\Controller\AdminController;
5
use Anomaly\Streams\Platform\Support\Authorizer;
6
7
/**
8
 * Class SystemController
9
 *
10
 * @link          http://pyrocms.com/
11
 * @author        PyroCMS, Inc. <[email protected]>
12
 * @author        Ryan Thompson <[email protected]>
13
 */
14
class SystemController extends AdminController
15
{
16
17
    /**
18
     * Return the form for editing preferences.
19
     *
20
     * @param  PreferenceFormBuilder                      $form
21
     * @param  Authorizer                                 $authorizer
22
     * @return \Symfony\Component\HttpFoundation\Response
23
     */
24
    public function edit(PreferenceFormBuilder $form, Authorizer $authorizer)
25
    {
26
        if (!$authorizer->authorize('anomaly.module.preferences::preferences.write')) {
27
            abort(403);
28
        }
29
30
        return $form->render('streams');
31
    }
32
}
33