Conditions | 7 |
Paths | 15 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function cleanTerms( array $termInLangIds ) { |
||
31 | $termInLangIdsAsKeys = array_flip( $termInLangIds ); |
||
32 | foreach ( $this->terms as $type => &$termsOfType ) { |
||
33 | foreach ( $termsOfType as $lang => &$termsOfLang ) { |
||
34 | foreach ( $termsOfLang as $term => $id ) { |
||
35 | if ( array_key_exists( $id, $termInLangIdsAsKeys ) ) { |
||
36 | unset( $termsOfLang[$term] ); |
||
37 | } |
||
38 | } |
||
39 | if ( $termsOfLang === [] ) { |
||
40 | unset( $termsOfType[$lang] ); |
||
41 | } |
||
42 | } |
||
43 | if ( $termsOfType === [] ) { |
||
44 | unset( $this->terms[$type] ); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | |||
50 |