NelmioApiDocBundle/ApiDocGenerator.php

42 lines
808 B
PHP
Raw Normal View History

2016-06-30 23:30:37 +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;
use EXSyst\Bundle\ApiDocBundle\Extractor\ExtractorInterface;
use gossi\swagger\Swagger;
class ApiDocGenerator
{
private $extractors;
/**
* @param ExtractorInterface[] $extractors
*/
public function __construct(array $extractors)
{
$this->extractors = $extractors;
}
/**
* @return Swagger
*/
public function extract()
{
$swagger = new Swagger();
foreach ($this->extractors as $extractor) {
$extractor->extractIn($swagger);
}
return $swagger;
}
}