| @@ 182-193 (lines=12) @@ | ||
| 179 | * |
|
| 180 | * @return string |
|
| 181 | */ |
|
| 182 | private function assureValidType($type) |
|
| 183 | { |
|
| 184 | foreach (self::getTypes() as $allowedType) { |
|
| 185 | if ($type === $allowedType) { |
|
| 186 | return $type; |
|
| 187 | } |
|
| 188 | } |
|
| 189 | ||
| 190 | throw new InvalidType( |
|
| 191 | sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class) |
|
| 192 | ); |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * @return array |
|
| @@ 73-84 (lines=12) @@ | ||
| 70 | * |
|
| 71 | * @return string |
|
| 72 | */ |
|
| 73 | private function assureValidType($type) |
|
| 74 | { |
|
| 75 | foreach (TailoredAudience::getTypes() as $allowedType) { |
|
| 76 | if ($type === $allowedType) { |
|
| 77 | return $type; |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| 81 | throw new InvalidType( |
|
| 82 | sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class) |
|
| 83 | ); |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * @return array |
|