8000 minor #36008 [FrameworkBundle] remove redundant PHPDoc in console Des… · symfony/symfony@cd08bf4 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd08bf4

Browse files
minor #36008 [FrameworkBundle] remove redundant PHPDoc in console Descriptor (noemi-salaun)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] remove redundant PHPDoc in console Descriptor | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | None <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | N/A The PHPDoc for some `describeXXX` methods in the abstract `Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor` was inaccurate or redundant. I remove the PHPDoc in the superclass and the `{@inheritdoc}` in the child class as suggested by @chalasr in this PR comment #35995 (comment) I keep the PHPDoc when it adds some explanation about the method or its params. For exemple : ### inaccurate: ```php /** * Describes an InputArgument instance. */ abstract protected function describeRouteCollection(RouteCollection $routes, array $options = []); /** * Describes an InputOption instance. */ abstract protected function describeRoute(Route $route, array $options = []); ``` ### redundant ```php /** * Describes container parameters. */ abstract protected function describeContainerParameters(ParameterBag $parameters, array $options = []); /** * Describes container tags. */ abstract protected function describeContainerTags(ContainerBuilder $builder, array $options = []); ``` ### kept ```php /** * Describes event dispatcher listeners. * * Common options are: * * name: name of listened event */ abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []); /** * Describes a callable. * * @param mixed $callable */ abstract protected function describeCallable($callable, array $options = []); ``` <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> Commits ------- e535e7d [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
2 parents bdd66aa + e535e7d commit cd08bf4

File tree

5 files changed

+0
-105
lines changed

5 files changed

+0
-105
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,12 @@ protected function write($content, $decorated = false)
100100
$this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
101101
}
102102

103-
/**
104-
* Describes an InputArgument instance.
105-
*/
106103
abstract protected function describeRouteCollection(RouteCollection $routes, array $options = []);
107104

108-
/**
109-
* Describes an InputOption instance.
110-
*/
111105
abstract protected function describeRoute(Route $route, array $options = []);
112106

113-
/**
114-
* Describes container parameters.
115-
*/
116107
abstract protected function describeContainerParameters(ParameterBag $parameters, array $options = []);
117108

118-
/**
119-
* Describes container tags.
120-
*/
121109
abstract protected function describeContainerTags(ContainerBuilder $builder, array $options = []);
122110

123111
/**
@@ -138,19 +126,10 @@ abstract protected function describeContainerService($service, array $options =
138126
*/
139127
abstract protected function describeContainerServices(ContainerBuilder $builder, array $options = []);
140128

141-
/**
142-
* Describes a service definition.
143-
*/
144129
abstract protected function describeContainerDefinition(Definition $definition, array $options = []);
145130

146-
/**
147-
* Describes a service alias.
148-
*/
149131
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null);
150132

151-
/**
152-
* Describes a container parameter.
153-
*/
154133
abstract protected function describeContainerParameter($parameter, array $options = []);
155134

156135
/**

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
*/
3030
class JsonDescriptor extends Descriptor
3131
{
32-
/**
33-
* {@inheritdoc}
34-
*/
3532
protected function describeRouteCollection(RouteCollection $routes, array $options = [])
3633
{
3734
$data = [];
@@ -42,25 +39,16 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
4239
$this->writeData($data, $options);
4340
}
4441

45-
/**
46-
* {@inheritdoc}
47-
*/
4842
protected function describeRoute(Route $route, array $options = [])
4943
{
5044
$this->writeData($this->getRouteData($route), $options);
5145
}
5246

53-
/**
54-
* {@inheritdoc}
55-
*/
5647
protected function describeContainerParameters(ParameterBag $parameters, array $options = [])
5748
{
5849
$this->writeData($this->sortParameters($parameters), $options);
5950
}
6051

61-
/**
62-
* {@inheritdoc}
63-
*/
6452
protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
6553
{
6654
$showPrivate = isset($options['show_private']) && $options['show_private'];
@@ -128,17 +116,11 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
128116
$this->writeData($data, $options);
129117
}
130118

131-
/**
132-
* {@inheritdoc}
133-
*/
134119
protected function describeContainerDefinition(Definition $definition, array $options = [])
135120
{
136121
$this->writeData($this->getContainerDefinitionData($definition, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']), $options);
137122
}
138123

139-
/**
140-
* {@inheritdoc}
141-
*/
142124
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
143125
{
144126
if (!$builder) {
@@ -169,9 +151,6 @@ protected function describeCallable($callable, array $options = [])
169151
$this->writeData($this->getCallableData($callable), $options);
170152
}
171153

172-
/**
173-
* {@inheritdoc}
174-
*/
175154
protected function describeContainerParameter($parameter, array $options = [])
176155
{
177156
$key = isset($options['parameter']) ? $options['parameter'] : '';

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 0 additions & 21 deletions
51
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
class MarkdownDescriptor extends Descriptor
2929
{
30-
/**
31-
* {@inheritdoc}
32-
*/
3330
protected function describeRouteCollection(RouteCollection $routes, array $options = [])
3431
{
3532
$first = true;
@@ -44,9 +41,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
4441
$this->write("\n");
4542
}
4643

47-
/**
48-
* {@inheritdoc}
49-
*/
5044
protected function describeRoute(Route $route, array $options = [])
45
{
5246
$output = '- Path: '.$route->getPath()
@@ -66,9 +60,6 @@ protected function describeRoute(Route $route, array $options = [])
6660
$this->write("\n");
6761
}
6862

69-
/**
70-
* {@inheritdoc}
71-
*/
7263
protected function describeContainerParameters(ParameterBag $parameters, array $options = [])
7364
{
7465
$this->write("Container parameters\n====================\n");
@@ -77,9 +68,6 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
7768
}
7869
}
7970

80-
/**
81-
* {@inheritdoc}
82-
*/
8371
protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
8472
{
8573
$showPrivate = isset($options['show_private']) && $options['show_private'];
@@ -176,9 +164,6 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
176164
}
177165
}
178166

179-
/**
180-
* {@inheritdoc}
181-
*/
182167
protected function describeContainerDefinition(Definition $definition, array $options = [])
183168
{
184169
$output = '- Class: `'.$definition->getClass().'`'
@@ -240,9 +225,6 @@ protected function describeContainerDefinition(Definition $definition, array $op
240225
$this->write(isset($options['id']) ? sprintf("### %s\n\n%s\n", $options['id'], $output) : $output);
241226
}
242227

243-
/**
244-
* {@inheritdoc}
245-
*/
246228
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
247229
{
248230
$output = '- Service: `'.$alias.'`'
@@ -264,9 +246,6 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
264246
$this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias]));
265247
}
266248

267-
/**
268-
* {@inheritdoc}
269-
*/
270249
protected function describeContainerParameter($parameter, array $options = [])
271250
{
272251
$this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', \strlen($options['parameter'])), $this->formatParameter($parameter)) : $parameter);

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
*/
3434
class TextDescriptor extends Descriptor
3535
{
36-
/**
37-
* {@inheritdoc}
38-
*/
3936
protected function describeRouteCollection(RouteCollection $routes, array $options = [])
4037
{
4138
$showControllers = isset($options['show_controllers']) && $options['show_controllers'];
@@ -72,9 +69,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
7269
}
7370
}
7471

75-
/**
76-
* {@inheritdoc}
77-
*/
7872
protected function describeRoute(Route $route, array $options = [])
7973
{
8074
$tableHeaders = ['Property', 'Value'];
@@ -100,9 +94,6 @@ protected function describeRoute(Route $route, array $options = [])
10094
$table->render();
10195
}
10296

103-
/**
104-
* {@inheritdoc}
105-
*/
10697
protected function describeContainerParameters(ParameterBag $parameters, array $options = [])
10798
{
10899
$tableHeaders = ['Parameter', 'Value'];
@@ -116,9 +107,6 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
116107
$options['output']->table($tableHeaders, $tableRows);
117108
}
118109

119-
/**
120-
* {@inheritdoc}
121-
*/
122110
protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
123111
{
124112
$showPrivate = isset($options['show_private']) && $options['show_private'];
@@ -252,9 +240,6 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
252240
$options['output']->table($tableHeaders, $tableRows);
253241
}
254242

255-
/**
256-
* {@inheritdoc}
257-
*/
258243
protected function describeContainerDefinition(Definition $definition, array $options = [])
259244
{
260245
if (isset($options['id'])) {
@@ -358,9 +343,6 @@ protected function describeContainerDefinition(Definition $definition, array $op
358343
$options['output']->table($tableHeaders, $tableRows);
359344
}
360345

361-
/**
362-
* {@inheritdoc}
363-
*/
364346
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
365347
{
366348
$options['output']->comment(sprintf('This service is an alias for the service <info>%s</info>', (string) $alias));
@@ -372,9 +354,6 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
372354
$this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias]));
373355
}
374356

375-
/**
376-
* {@inheritdoc}
377-
*/
378357
protected function describeContainerParameter($parameter, array $options = [])
379358
{
380359
$options['output']->table(

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,21 @@
2929
*/
3030
class XmlDescriptor extends Descriptor
3131
{
32-
/**
33-
* {@inheritdoc}
34-
*/
3532
protected function describeRouteCollection(RouteCollection $routes, array $options = [])
3633
{
3734
$this->writeDocument($this->getRouteCollectionDocument($routes));
3835
}
3936

40-
/**
41-
* {@inheritdoc}
42-
*/
4337
protected function describeRoute(Route $route, array $options = [])
4438
{
4539
$this->writeDocument($this->getRouteDocument($route, isset($options['name']) ? $options['name'] : null));
4640
}
4741

48-
/**
49-
* {@inheritdoc}
50-
*/
5142
protected function describeContainerParameters(ParameterBag $parameters, array $options = [])
5243
{
5344
$this->writeDocument($this->getContainerParametersDocument($parameters));
5445
}
5546

56-
/**
57-
* {@inheritdoc}
58-
*/
5947
protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
6048
{
6149
$this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_private']) && $options['show_private']));
@@ -81,17 +69,11 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
8169
$this->writeDocument($this->getContainerServicesDocument($builder, isset($options['tag']) ? $options['tag'] : null, isset($options['show_private']) && $options['show_private'], isset($options['show_arguments']) && $options['show_arguments'], isset($options['filter']) ? $options['filter'] : null));
8270
}
8371

84-
/**
85-
* {@inheritdoc}
86-
*/
8772
protected function describeContainerDefinition(Definition $definition, array $options = [])
8873
{
8974
$this->writeDocument($this->getContainerDefinitionDocument($definition, isset($options['id']) ? $options['id'] : null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']));
9075
}
9176

92-
/**
93-
* {@inheritdoc}
94-
*/
9577
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
9678
{
9779
$dom = new \DOMDocument('1.0', 'UTF-8');
@@ -124,9 +106,6 @@ protected function describeCallable($callable, array $options = [])
124106
$this->writeDocument($this->getCallableDocument($callable));
125107
}
126108

127-
/**
128-
* {@inheritdoc}
129-
*/
130109
protected function describeContainerParameter($parameter, array $options = [])
131110
{
132111
$this->writeDocument($this->getContainerParameterDocument($parameter, $options));

0 commit comments

Comments
 (0)
0