1 | <?php |
||
19 | class SuperfluousComment extends AbstractRule implements ClassAware |
||
20 | { |
||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | private $percent; |
||
25 | |||
26 | /** |
||
27 | * @param AbstractNode $node |
||
28 | */ |
||
29 | 3 | public function apply(AbstractNode $node) |
|
45 | |||
46 | /** |
||
47 | * @param AbstractNode $node |
||
48 | */ |
||
49 | 3 | private function checkClass(AbstractNode $node) |
|
57 | |||
58 | /** |
||
59 | * @param AbstractNode|ASTClass $node |
||
60 | */ |
||
61 | 3 | private function checkProperties(AbstractNode $node) |
|
71 | |||
72 | /** |
||
73 | * @param AbstractNode|ClassNode $node |
||
74 | */ |
||
75 | 3 | private function checkMethods(AbstractNode $node) |
|
85 | |||
86 | /** |
||
87 | * @param AbstractNode $node |
||
88 | * @param string $type |
||
89 | * @param int $percent |
||
90 | */ |
||
91 | 3 | private function checkNode(AbstractNode $node, $type, $percent) |
|
97 | |||
98 | /** |
||
99 | * @param AbstractNode|AbstractASTArtifact $node |
||
100 | * |
||
101 | * @return float |
||
102 | */ |
||
103 | 3 | private function calculateNameToCommentSimilarityInPercent($node) |
|
119 | |||
120 | /** |
||
121 | * @param string $docComment |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | 2 | private function getCommentDescription($docComment) |
|
139 | |||
140 | /** |
||
141 | * @param array $descriptionLines |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | 2 | private function transformDescriptionLines(array $descriptionLines) |
|
155 | |||
156 | /** |
||
157 | * @param string $string |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | 2 | private function transformString($string) |
|
168 | } |
||
169 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: