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); unset($documentation['basePath']); return $documentation; }); } }