Nelmio\Alice\Throwable\Exception\FixtureBuilder\Denormalizer\DenormalizerExceptionFactory::createForUndenormalizableConstructor PHP Méthode

createForUndenormalizableConstructor() public static méthode

public static createForUndenormalizableConstructor ( ) : UnexpectedValueException
Résultat UnexpectedValueException
    public static function createForUndenormalizableConstructor() : UnexpectedValueException
    {
        return new UnexpectedValueException('Could not denormalize the given constructor.');
    }

Usage Example

 /**
  * {@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();
 }