Skip to content

Commit 07ceaee

Browse files
committed
Don't override parent parameter in the Swagger command
1 parent 91dc2a4 commit 07ceaee

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@ final class SwaggerCommand extends Command
2727
{
2828
private $documentationNormalizer;
2929
private $resourceNameCollectionFactory;
30-
private $title;
31-
private $description;
32-
private $version;
33-
private $formats;
30+
private $apiTitle;
31+
private $apiDescription;
32+
private $apiVersion;
33+
private $apiFormats;
3434

35-
public function __construct(DocumentationNormalizer $documentationNormalizer, ResourceNameCollectionFactoryInterface $resourceNameCollection, string $title, string $description, string $version, array $formats)
35+
public function __construct(DocumentationNormalizer $documentationNormalizer, ResourceNameCollectionFactoryInterface $resourceNameCollection, string $apiTitle, string $apiDescription, string $apiVersion, array $apiFormats)
3636
{
3737
parent::__construct();
38+
3839
$this->documentationNormalizer = $documentationNormalizer;
3940
$this->resourceNameCollectionFactory = $resourceNameCollection;
40-
$this->title = $title;
41-
$this->description = $description;
42-
$this->version = $version;
43-
$this->formats = $formats;
41+
$this->apiTitle = $apiTitle;
42+
$this->apiDescription = $apiDescription;
43+
$this->apiVersion = $apiVersion;
44+
$this->apiFormats = $apiFormats;
4445
}
4546

4647
/**
@@ -58,7 +59,7 @@ protected function configure()
5859
*/
5960
protected function execute(InputInterface $input, OutputInterface $output)
6061
{
61-
$documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->title, $this->description, $this->version, $this->formats);
62+
$documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats);
6263
$data = $this->documentationNormalizer->normalize($documentation);
6364
$content = json_encode($data, JSON_PRETTY_PRINT);
6465
$output->writeln($content);

0 commit comments

Comments
 (0)