private function assertFlatChoiceViewsArray(array $choiceViews) { foreach ($choiceViews as $choiceView) { if (!$choiceView instanceof ChoiceView) { throw new \InvalidArgumentException('Only a flat choice hierarchy is supported'); } } }