| Conditions | 6 |
| Paths | 10 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function is_fulfilled( $environment ) { |
||
| 31 | $term = $environment['term']; |
||
| 32 | $parent_term_id = $term ? intval( $term->parent ) : 0; |
||
| 33 | $value = $this->get_value(); |
||
| 34 | |||
| 35 | switch ( $this->get_comparison_operator() ) { |
||
| 36 | case '=': // fallthrough intended |
||
| 37 | case '!=': |
||
| 38 | $value = $this->get_term_id_from_full_term_descriptor( $value ); |
||
| 39 | break; |
||
| 40 | |||
| 41 | case 'IN': // fallthrough intended |
||
| 42 | case 'NOT IN': |
||
| 43 | $value = $this->get_term_ids_from_full_term_descriptors( $value ); |
||
| 44 | break; |
||
| 45 | } |
||
| 46 | |||
| 47 | return $this->compare( |
||
| 48 | $parent_term_id, |
||
| 49 | $this->get_comparison_operator(), |
||
| 50 | $value |
||
| 51 | ); |
||
| 52 | } |
||
| 53 | } |