NelmioApiDocBundle/Describer/SwaggerPhpDescriber.php

28 lines
659 B
PHP
Raw Normal View History

2016-07-28 10:20:59 +02:00
<?php
/*
* This file is part of the ApiDocBundle package.
*
* (c) EXSyst
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace EXSyst\Bundle\ApiDocBundle\Describer;
2016-07-29 10:22:40 +02:00
class SwaggerPhpDescriber extends ExternalDocDescriber
2016-07-28 10:20:59 +02:00
{
/**
* @param string $projectPath
*/
public function __construct(string $projectPath, bool $overwrite = false)
{
2016-07-29 10:22:40 +02:00
parent::__construct(function () use ($projectPath) {
$annotation = \Swagger\scan($projectPath);
2016-07-28 10:20:59 +02:00
2016-07-29 10:22:40 +02:00
return json_decode(json_encode($annotation));
}, $overwrite);
2016-07-28 10:20:59 +02:00
}
}