Respect invalid argument syntax used by PHP at ApiPlatformDescriber::__construct()

This commit is contained in:
Javier Spagnoletti 2018-03-17 10:51:50 -03:00
parent d604e4c270
commit 3c9bde427e

View File

@ -21,7 +21,7 @@ final class ApiPlatformDescriber extends ExternalDocDescriber
public function __construct(Documentation $documentation, $normalizer, UrlGeneratorInterface $urlGenerator)
{
if (!$normalizer instanceof ApiGatewayNormalizer && !$normalizer instanceof DocumentationNormalizer) {
throw new \LogicException(sprintf('Argument $normalizer of %s must be an instance of %s or %s. %s provided.', __METHOD__, ApiGatewayNormalizer::class, DocumentationNormalizer::class, get_class($normalizer)));
throw new \InvalidArgumentException(sprintf('Argument 2 passed to %s() must be an instance of %s or %s, %s given.', __METHOD__, ApiGatewayNormalizer::class, DocumentationNormalizer::class, get_class($normalizer)));
}
parent::__construct(function () use ($documentation, $normalizer, $urlGenerator) {