Total Complexity | 8 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 14 | ||
Bugs | 12 | Features | 0 |
1 | <?php |
||
16 | class URIFilter extends Filter |
||
17 | { |
||
18 | /** |
||
19 | * @var array|string |
||
20 | */ |
||
21 | public $uri; |
||
22 | /** |
||
23 | * @var Request|null |
||
24 | */ |
||
25 | protected $request; |
||
26 | |||
27 | /** |
||
28 | * @inheritdoc |
||
29 | */ |
||
30 | public function init() |
||
31 | { |
||
32 | if (Yii::$app instanceof Application) { |
||
33 | $this->request = Yii::$app->request; |
||
34 | } |
||
35 | if (is_string($this->uri)) { |
||
36 | $this->uri = [$this->uri]; |
||
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return bool |
||
42 | * @throws NotFoundHttpException |
||
43 | */ |
||
44 | public function isAllowed() |
||
51 | } |
||
52 | } |
||
53 |