| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function is_fulfilled( $environment ) { |
||
| 34 | switch ( $this->get_comparison_operator() ) { |
||
| 35 | case '=': |
||
| 36 | return current_user_can( $this->get_value() ); |
||
| 37 | break; |
||
|
1 ignored issue
–
show
|
|||
| 38 | case '!=': |
||
| 39 | return ! current_user_can( $this->get_value() ); |
||
| 40 | break; |
||
|
1 ignored issue
–
show
|
|||
| 41 | case 'IN': |
||
| 42 | return $this->current_user_can_any( $this->get_value() ); |
||
| 43 | break; |
||
|
1 ignored issue
–
show
|
|||
| 44 | case 'NOT IN': |
||
| 45 | return ! $this->current_user_can_any( $this->get_value() ); |
||
| 46 | break; |
||
|
1 ignored issue
–
show
|
|||
| 47 | } |
||
| 48 | |||
| 49 | return $this->first_supported_comparer_is_correct( |
||
| 50 | get_current_user_id(), |
||
| 51 | $this->get_comparison_operator(), |
||
| 52 | $this->get_value() |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | } |
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.