Skip to content

Commit

Permalink
Merge pull request #630 from dunglas/swagger_command_override
Browse files Browse the repository at this point in the history
Don't override parent parameter in the Swagger command
  • Loading branch information
dunglas committed Jul 16, 2016
2 parents 1f2458c + 07ceaee commit f1cbd32
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ final class SwaggerCommand extends Command
{
private $documentationNormalizer;
private $resourceNameCollectionFactory;
private $title;
private $description;
private $version;
private $formats;
private $apiTitle;
private $apiDescription;
private $apiVersion;
private $apiFormats;

public function __construct(DocumentationNormalizer $documentationNormalizer, ResourceNameCollectionFactoryInterface $resourceNameCollection, string $title, string $description, string $version, array $formats)
public function __construct(DocumentationNormalizer $documentationNormalizer, ResourceNameCollectionFactoryInterface $resourceNameCollection, string $apiTitle, string $apiDescription, string $apiVersion, array $apiFormats)
{
parent::__construct();

$this->documentationNormalizer = $documentationNormalizer;
$this->resourceNameCollectionFactory = $resourceNameCollection;
$this->title = $title;
$this->description = $description;
$this->version = $version;
$this->formats = $formats;
$this->apiTitle = $apiTitle;
$this->apiDescription = $apiDescription;
$this->apiVersion = $apiVersion;
$this->apiFormats = $apiFormats;
}

/**
Expand All @@ -58,7 +59,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->title, $this->description, $this->version, $this->formats);
$documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats);
$data = $this->documentationNormalizer->normalize($documentation);
$content = json_encode($data, JSON_PRETTY_PRINT);
$output->writeln($content);
Expand Down

0 comments on commit f1cbd32

Please sign in to comment.