/** * {@inheritdoc} * * @throws UnexpectedValueException */ public function denormalize(FixtureInterface $scope, FlagParserInterface $parser, array $unparsedConstructor) : MethodCallInterface { /** @var int|string|null $firstKey */ $firstKey = key($unparsedConstructor); if (null === $firstKey || is_int($firstKey) || count($unparsedConstructor) > 1 || is_string($firstKey) && preg_match('/\\(.*\\)/', $firstKey)) { return new SimpleMethodCall('__construct', $this->argumentDenormalizer->denormalize($scope, $parser, $unparsedConstructor)); } throw DenormalizerExceptionFactory::createForUndenormalizableConstructor(); }