NelmioApiDocBundle/Describer/ApiPlatformDescriber.php

26 lines
745 B
PHP
Raw Normal View History

2016-07-29 10:22:40 +02:00
<?php
/*
2016-12-29 12:09:26 +01:00
* This file is part of the NelmioApiDocBundle package.
2016-07-29 10:22:40 +02:00
*
2016-12-29 12:09:26 +01:00
* (c) Nelmio
2016-07-29 10:22:40 +02:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2016-12-29 12:09:26 +01:00
namespace Nelmio\ApiDocBundle\Describer;
2016-07-29 10:22:40 +02:00
use ApiPlatform\Core\Documentation\Documentation;
2016-11-18 22:16:53 +01:00
use ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer;
2016-07-29 10:22:40 +02:00
2016-11-30 15:04:53 +01:00
final class ApiPlatformDescriber extends ExternalDocDescriber
2016-07-29 10:22:40 +02:00
{
public function __construct(Documentation $documentation, DocumentationNormalizer $normalizer, bool $overwrite = false)
{
parent::__construct(function () use ($documentation, $normalizer) {
2016-11-18 22:16:53 +01:00
return (array) $normalizer->normalize($documentation);
2016-07-29 10:22:40 +02:00
}, $overwrite);
}
}