File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1313namespace StfalconStudio \SwaggerBundle \Command ;
1414
1515use StfalconStudio \SwaggerBundle \Generator \Generator ;
16+ use Symfony \Component \Console \Attribute \AsCommand ;
1617use Symfony \Component \Console \Command \Command ;
1718use Symfony \Component \Console \Input \InputInterface ;
1819use Symfony \Component \Console \Output \OutputInterface ;
1920
2021/**
2122 * GenerateDocsCommand.
2223 */
24+ #[AsCommand(name: 'swagger:generate-docs ' , description: 'Generates swagger docs ' )]
2325class GenerateDocsCommand extends Command
2426{
25- protected static $ defaultName = 'swagger:generate-docs ' ;
26-
27- private Generator $ generator ;
27+ private readonly Generator $ generator ;
2828
2929 /**
3030 * @param Generator $generator
@@ -42,7 +42,6 @@ public function __construct(Generator $generator)
4242 protected function configure (): void
4343 {
4444 $ this
45- ->setDescription ('Generate swagger docs ' )
4645 ->setHelp ('This command generate swagger docs. ' )
4746 ;
4847 }
Original file line number Diff line number Diff line change 2121 */
2222class Generator
2323{
24- private Environment $ twig ;
24+ private readonly Environment $ twig ;
2525
26- private ConfigParser $ configParser ;
26+ private readonly ConfigParser $ configParser ;
2727
28- private string $ docsFolder ;
28+ private readonly string $ docsFolder ;
2929
3030 /**
3131 * @param Environment $twig
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ final class GeneratorTest extends TestCase
2626 private string $ docsFile = __DIR__ .'/Fixtures/index.html ' ;
2727
2828 /** @var Environment|MockObject */
29- private $ twig ;
29+ private Environment | MockObject $ twig ;
3030
3131 /** @var ConfigParser|MockObject */
32- private $ parser ;
32+ private ConfigParser | MockObject $ parser ;
3333
3434 private Filesystem $ filesystem ;
3535
You can’t perform that action at this time.
0 commit comments