supportsNormalization($documentation, 'json')) { throw new \InvalidArgumentException(sprintf('Argument 2 passed to %s() must implement %s and support normalization of %s. The normalizer provided is an instance of %s.', __METHOD__, NormalizerInterface::class, Documentation::class, get_class($normalizer))); } parent::__construct(function () use ($documentation, $normalizer) { $documentation = (array) $normalizer->normalize( $documentation, null, [DocumentationNormalizer::SPEC_VERSION => 3] ); unset($documentation['basePath']); return $documentation; }); } }