1 | <?php |
||
20 | class User extends \yii\web\User |
||
21 | { |
||
22 | const PUBLIC_ROLE = 'Public'; |
||
23 | |||
24 | /** |
||
25 | * Extended permission check with `Guest` role and `route`. |
||
26 | * |
||
27 | * @param string $permissionName |
||
28 | * @param array $params |
||
29 | * @param bool|true $allowCaching |
||
30 | * |
||
31 | * @return bool |
||
32 | */ |
||
33 | public function can($permissionName, $params = [], $allowCaching = true) |
||
47 | |||
48 | /** |
||
49 | * Checks permissions from guest role, when no user is logged in. |
||
50 | * |
||
51 | * @param $permissionName |
||
52 | * @param $params |
||
53 | * @param $allowCaching |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | private function canGuest($permissionName, $params, $allowCaching) |
||
63 | |||
64 | /** |
||
65 | * Checks route permissions. |
||
66 | * |
||
67 | * Splits `permissionName` by underscore and match parts against more global rule |
||
68 | * eg. a permission `app_site` will match, `app_site_foo` |
||
69 | * |
||
70 | * @param $permissionName |
||
71 | * @param $params |
||
72 | * @param $allowCaching |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | private function checkAccessRoute($permissionName, $params, $allowCaching) |
||
95 | } |
||
96 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.