| @@ 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 |
|
| @@ 193-204 (lines=12) @@ | ||
| 190 | * |
|
| 191 | * @return string |
|
| 192 | */ |
|
| 193 | private function assureValidType($type) |
|
| 194 | { |
|
| 195 | foreach (self::getTypes() as $allowedType) { |
|
| 196 | if ($type === $allowedType) { |
|
| 197 | return $type; |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||
| 201 | throw new InvalidType( |
|
| 202 | sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class) |
|
| 203 | ); |
|
| 204 | } |
|
| 205 | ||
| 206 | /** |
|
| 207 | * @return array |
|