Nelmio\Alice\Throwable\Error\TypeErrorFactory::createForInvalidSpecificationBagMethodCallName PHP Method

createForInvalidSpecificationBagMethodCallName() public static method

public static createForInvalidSpecificationBagMethodCallName ( $unparsedMethod ) : TypeError
return TypeError
    public static function createForInvalidSpecificationBagMethodCallName($unparsedMethod) : \TypeError
    {
        return new \TypeError(sprintf('Expected method name, got "%s" instead.', gettype($unparsedMethod)));
    }

Usage Example

 private function denormalizeCallMethod(CallsDenormalizerInterface $callsDenormalizer, $methodCall, FixtureInterface $scope, FlagParserInterface $parser) : MethodCallInterface
 {
     if (false === is_array($methodCall)) {
         throw TypeErrorFactory::createForInvalidSpecificationBagMethodCall($methodCall);
     }
     $unparsedMethod = key($methodCall);
     if (false === is_string($unparsedMethod)) {
         throw TypeErrorFactory::createForInvalidSpecificationBagMethodCallName($unparsedMethod);
     }
     return $callsDenormalizer->denormalize($scope, $parser, $unparsedMethod, $methodCall[$unparsedMethod]);
 }