Completed
Push — master ( b847e9...aea582 )
by Ryan
02:11
created

GetSortableFlag::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace Anomaly\DashboardModule\Widget\Command;
2
3
use Anomaly\DashboardModule\Widget\Contract\WidgetInterface;
4
use Anomaly\Streams\Platform\Support\Authorizer;
5
use Illuminate\Contracts\Bus\SelfHandling;
6
7
/**
8
 * Class GetSortableFlag
9
 *
10
 * @link          http://pyrocms.com/
11
 * @author        PyroCMS, Inc. <[email protected]>
12
 * @author        Ryan Thompson <[email protected]>
13
 * @package       Anomaly\DashboardModule\Widget\Command
14
 */
15
class GetSortableFlag implements SelfHandling
16
{
17
18
    /**
19
     * The widget instance.
20
     *
21
     * @var WidgetInterface
22
     */
23
    protected $widget;
24
25
    /**
26
     * Create a new GetSortableFlag instance.
27
     *
28
     * @param WidgetInterface $widget
29
     */
30
    public function __construct(WidgetInterface $widget)
31
    {
32
        $this->widget = $widget;
33
    }
34
35
    /**
36
     * Handle the command.
37
     *
38
     * @param Authorizer $authorizer
39
     * @return bool
40
     */
41
    public function handle(Authorizer $authorizer)
42
    {
43
        return $authorizer->authorize('anomaly.module.dashboard::dashboard.write');
44
    }
45
}
46