Conditions | 5 |
Paths | 5 |
Total Lines | 28 |
Code Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
89 | public function is_fulfilled( $environment ) { |
||
90 | $term_id = $environment['term_id']; |
||
91 | |||
92 | switch ( $this->get_comparison_operator() ) { |
||
93 | case '=': |
||
94 | $value_term_id = $this->get_term_id_from_full_term_descriptor( $this->get_value() ); |
||
95 | return $term_id == $value_term_id; |
||
96 | break; |
||
1 ignored issue
–
show
|
|||
97 | case '!=': |
||
98 | $value_term_id = $this->get_term_id_from_full_term_descriptor( $this->get_value() ); |
||
99 | return $term_id != $value_term_id; |
||
100 | break; |
||
1 ignored issue
–
show
|
|||
101 | case 'IN': |
||
102 | $value_term_ids = $this->get_term_ids_from_full_term_descriptors( $this->get_value() ); |
||
103 | return in_array( $term_id, $value_term_ids ); |
||
104 | break; |
||
1 ignored issue
–
show
|
|||
105 | case 'NOT IN': |
||
106 | $value_term_ids = $this->get_term_ids_from_full_term_descriptors( $this->get_value() ); |
||
107 | return ! in_array( $term_id, $value_term_ids ); |
||
108 | break; |
||
1 ignored issue
–
show
|
|||
109 | } |
||
110 | |||
111 | return $this->compare( |
||
112 | $term_id, |
||
113 | $this->get_comparison_operator(), |
||
114 | $this->get_value() |
||
115 | ); |
||
116 | } |
||
117 | } |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.