Skip to content

Commit 91c342f

Browse files
committed
minor #47390 [CS] Remove @inheritdoc PHPDoc (lyrixx)
This PR was merged into the 6.2 branch. Discussion ---------- [CS] Remove `@inheritdoc` PHPDoc | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | --- It looks like this PHP Doc is useless. IDEs are able to inherit the doc (at least VS Code and PHP Storm). And tools like PHP Stan are able to too https://phpstan.org/r/74a2c008-ff2b-42c0-8edf-8da87c1a7b5f I could have open an RFC before doing the PR, but it was easy :) So let's discuss here Commits ------- 015d5015e3 [CS] Remove `@inheritdoc` PHPDoc
2 parents b4491ac + 021fd05 commit 91c342f

28 files changed

+0
-120
lines changed

Node/AttributeNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public function getValue(): ?string
6363
return $this->value;
6464
}
6565

66-
/**
67-
* {@inheritdoc}
68-
*/
6966
public function getSpecificity(): Specificity
7067
{
7168
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));

Node/ClassNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getName(): string
4242
return $this->name;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));

Node/CombinedSelectorNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function getSubSelector(): NodeInterface
4949
return $this->subSelector;
5050
}
5151

52-
/**
53-
* {@inheritdoc}
54-
*/
5552
public function getSpecificity(): Specificity
5653
{
5754
return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());

Node/ElementNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getElement(): ?string
4242
return $this->element;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return new Specificity(0, 0, $this->element ? 1 : 0);

Node/FunctionNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public function getArguments(): array
5757
return $this->arguments;
5858
}
5959

60-
/**
61-
* {@inheritdoc}
62-
*/
6360
public function getSpecificity(): Specificity
6461
{
6562
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));

Node/HashNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getId(): string
4242
return $this->id;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));

Node/NegationNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getSubSelector(): NodeInterface
4242
return $this->subSelector;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());

Node/PseudoNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getIdentifier(): string
4242
return $this->identifier;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));

Node/SelectorNode.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getPseudoElement(): ?string
4242
return $this->pseudoElement;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getSpecificity(): Specificity
4946
{
5047
return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));

Parser/Handler/CommentHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
*/
2727
class CommentHandler implements HandlerInterface
2828
{
29-
/**
30-
* {@inheritdoc}
31-
*/
3229
public function handle(Reader $reader, TokenStream $stream): bool
3330
{
3431
if ('/*' !== $reader->getSubstring(2)) {

Parser/Handler/HashHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca
3838
$this->escaping = $escaping;
3939
}
4040

41-
/**
42-
* {@inheritdoc}
43-
*/
4441
public function handle(Reader $reader, TokenStream $stream): bool
4542
{
4643
$match = $reader->findPattern($this->patterns->getHashPattern());

Parser/Handler/IdentifierHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca
3838
$this->escaping = $escaping;
3939
}
4040

41-
/**
42-
* {@inheritdoc}
43-
*/
4441
public function handle(Reader $reader, TokenStream $stream): bool
4542
{
4643
$match = $reader->findPattern($this->patterns->getIdentifierPattern());

Parser/Handler/NumberHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public function __construct(TokenizerPatterns $patterns)
3535
$this->patterns = $patterns;
3636
}
3737

38-
/**
39-
* {@inheritdoc}
40-
*/
4138
public function handle(Reader $reader, TokenStream $stream): bool
4239
{
4340
$match = $reader->findPattern($this->patterns->getNumberPattern());

Parser/Handler/StringHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca
4040
$this->escaping = $escaping;
4141
}
4242

43-
/**
44-
* {@inheritdoc}
45-
*/
4643
public function handle(Reader $reader, TokenStream $stream): bool
4744
{
4845
$quote = $reader->getSubstring(1);

Parser/Handler/WhitespaceHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
class WhitespaceHandler implements HandlerInterface
2929
{
30-
/**
31-
* {@inheritdoc}
32-
*/
3330
public function handle(Reader $reader, TokenStream $stream): bool
3431
{
3532
$match = $reader->findPattern('~^[ \t\r\n\f]+~');

Parser/Parser.php

-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ public function __construct(Tokenizer $tokenizer = null)
3434
$this->tokenizer = $tokenizer ?? new Tokenizer();
3535
}
3636

37-
/**
38-
* {@inheritdoc}
39-
*/
4037
public function parse(string $source): array
4138
{
4239
$reader = new Reader($source);

Parser/Shortcut/ClassParser.php

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
*/
2929
class ClassParser implements ParserInterface
3030
{
31-
/**
32-
* {@inheritdoc}
33-
*/
3431
public function parse(string $source): array
3532
{
3633
// Matches an optional namespace, optional element, and required class

Parser/Shortcut/ElementParser.php

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
class ElementParser implements ParserInterface
2929
{
30-
/**
31-
* {@inheritdoc}
32-
*/
3330
public function parse(string $source): array
3431
{
3532
// Matches an optional namespace, required element or `*`

Parser/Shortcut/EmptyStringParser.php

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
*/
3232
class EmptyStringParser implements ParserInterface
3333
{
34-
/**
35-
* {@inheritdoc}
36-
*/
3734
public function parse(string $source): array
3835
{
3936
// Matches an empty string

Parser/Shortcut/HashParser.php

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
*/
2929
class HashParser implements ParserInterface
3030
{
31-
/**
32-
* {@inheritdoc}
33-
*/
3431
public function parse(string $source): array
3532
{
3633
// Matches an optional namespace, optional element, and required id

XPath/Extension/AbstractExtension.php

-15
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,26 @@
2323
*/
2424
abstract class AbstractExtension implements ExtensionInterface
2525
{
26-
/**
27-
* {@inheritdoc}
28-
*/
2926
public function getNodeTranslators(): array
3027
{
3128
return [];
3229
}
3330

34-
/**
35-
* {@inheritdoc}
36-
*/
3731
public function getCombinationTranslators(): array
3832
{
3933
return [];
4034
}
4135

42-
/**
43-
* {@inheritdoc}
44-
*/
4536
public function getFunctionTranslators(): array
4637
{
4738
return [];
4839
}
4940

50-
/**
51-
* {@inheritdoc}
52-
*/
5341
public function getPseudoClassTranslators(): array
5442
{
5543
return [];
5644
}
5745

58-
/**
59-
* {@inheritdoc}
60-
*/
6146
public function getAttributeMatchingTranslators(): array
6247
{
6348
return [];

XPath/Extension/AttributeMatchingExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
*/
2727
class AttributeMatchingExtension extends AbstractExtension
2828
{
29-
/**
30-
* {@inheritdoc}
31-
*/
3229
public function getAttributeMatchingTranslators(): array
3330
{
3431
return [
@@ -109,9 +106,6 @@ public function translateDifferent(XPathExpr $xpath, string $attribute, ?string
109106
));
110107
}
111108

112-
/**
113-
* {@inheritdoc}
114-
*/
115109
public function getName(): string
116110
{
117111
return 'attribute-matching';

XPath/Extension/CombinationExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
*/
2626
class CombinationExtension extends AbstractExtension
2727
{
28-
/**
29-
* {@inheritdoc}
30-
*/
3128
public function getCombinationTranslators(): array
3229
{
3330
return [
@@ -61,9 +58,6 @@ public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedX
6158
return $xpath->join('/following-sibling::', $combinedXpath);
6259
}
6360

64-
/**
65-
* {@inheritdoc}
66-
*/
6761
public function getName(): string
6862
{
6963
return 'combination';

XPath/Extension/FunctionExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
*/
3131
class FunctionExtension extends AbstractExtension
3232
{
33-
/**
34-
* {@inheritdoc}
35-
*/
3633
public function getFunctionTranslators(): array
3734
{
3835
return [
@@ -161,9 +158,6 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathEx
161158
));
162159
}
163160

164-
/**
165-
* {@inheritdoc}
166-
*/
167161
public function getName(): string
168162
{
169163
return 'function';

XPath/Extension/HtmlExtension.php

-9
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public function __construct(Translator $translator)
3636
->setFlag(NodeExtension::ATTRIBUTE_NAME_IN_LOWER_CASE, true);
3737
}
3838

39-
/**
40-
* {@inheritdoc}
41-
*/
4239
public function getPseudoClassTranslators(): array
4340
{
4441
return [
@@ -53,9 +50,6 @@ public function getPseudoClassTranslators(): array
5350
];
5451
}
5552

56-
/**
57-
* {@inheritdoc}
58-
*/
5953
public function getFunctionTranslators(): array
6054
{
6155
return [
@@ -177,9 +171,6 @@ public function translateVisited(XPathExpr $xpath): XPathExpr
177171
return $xpath->addCondition('0');
178172
}
179173

180-
/**
181-
* {@inheritdoc}
182-
*/
183174
public function getName(): string
184175
{
185176
return 'html';

XPath/Extension/NodeExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ public function hasFlag(int $flag): bool
5959
return (bool) ($this->flags & $flag);
6060
}
6161

62-
/**
63-
* {@inheritdoc}
64-
*/
6562
public function getNodeTranslators(): array
6663
{
6764
return [
@@ -182,9 +179,6 @@ public function translateElement(Node\ElementNode $node): XPathExpr
182179
return $xpath;
183180
}
184181

185-
/**
186-
* {@inheritdoc}
187-
*/
188182
public function getName(): string
189183
{
190184
return 'node';

XPath/Extension/PseudoClassExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
*/
2727
class PseudoClassExtension extends AbstractExtension
2828
{
29-
/**
30-
* {@inheritdoc}
31-
*/
3229
public function getPseudoClassTranslators(): array
3330
{
3431
return [
@@ -112,9 +109,6 @@ public function translateEmpty(XPathExpr $xpath): XPathExpr
112109
return $xpath->addCondition('not(*) and not(string-length())');
113110
}
114111

115-
/**
116-
* {@inheritdoc}
117-
*/
118112
public function getName(): string
119113
{
120114
return 'pseudo-class';

XPath/Translator.php

-6
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ public static function getXpathLiteral(string $element): string
8787
return sprintf('concat(%s)', implode(', ', $parts));
8888
}
8989

90-
/**
91-
* {@inheritdoc}
92-
*/
9390
public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string
9491
{
9592
$selectors = $this->parseSelectors($cssExpr);
@@ -106,9 +103,6 @@ public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self
106103
return implode(' | ', $selectors);
107104
}
108105

109-
/**
110-
* {@inheritdoc}
111-
*/
112106
public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string
113107
{
114108
return ($prefix ?: '').$this->nodeToXPath($selector);

0 commit comments

Comments
 (0)