| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 13 |   public function expand($values) { | ||
| 14 | $return = []; | ||
| 15 |     foreach ($values as $name) { | ||
| 16 | $terms = taxonomy_get_term_by_name($name, $this->getVocab()); | ||
| 17 |       if (!$terms) { | ||
| 18 |         throw new \Exception(sprintf("No term '%s' exists.", $name)); | ||
| 19 | } | ||
| 20 | $return[$this->language][] = ['tid' => array_shift($terms)->tid]; | ||
| 21 | } | ||
| 22 | return $return; | ||
| 23 | } | ||
| 24 | |||
| 39 |