| 1 | <?php |
||
| 10 | class User_Capability_Condition extends Condition { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Get user id from environment |
||
| 14 | * |
||
| 15 | * @param array $environment |
||
| 16 | * @return array<string> |
||
| 17 | */ |
||
| 18 | protected function get_user_id( $environment ) { |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Check if a user has any of the supplied capabilities |
||
| 24 | * |
||
| 25 | * @param array<string> $capabilities |
||
| 26 | * @return boolean |
||
| 27 | */ |
||
| 28 | protected function user_can_any( $user_id, $capabilities ) { |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Check if the condition is fulfilled |
||
| 39 | * |
||
| 40 | * @param array $environment |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | public function is_fulfilled( $environment ) { |
||
| 66 | } |
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.