1 | <?php |
||
15 | class CommentDescription extends AbstractRule implements ClassAware |
||
16 | { |
||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | private $percent; |
||
21 | |||
22 | /** |
||
23 | * @param AbstractNode $node |
||
24 | */ |
||
25 | 4 | public function apply(AbstractNode $node) |
|
41 | |||
42 | /** |
||
43 | * @param AbstractNode $node |
||
44 | */ |
||
45 | 4 | private function checkClass(AbstractNode $node) |
|
53 | |||
54 | /** |
||
55 | * @param AbstractNode|ASTClass $node |
||
56 | */ |
||
57 | 4 | private function checkProperties(AbstractNode $node) |
|
67 | |||
68 | /** |
||
69 | * @param AbstractNode|ClassNode $node |
||
70 | */ |
||
71 | 4 | private function checkMethods(AbstractNode $node) |
|
81 | |||
82 | /** |
||
83 | * @param AbstractNode $node |
||
84 | * @param string $type |
||
85 | * @param int $percent |
||
86 | */ |
||
87 | 4 | private function checkNode(AbstractNode $node, $type, $percent) |
|
93 | |||
94 | /** |
||
95 | * @param AbstractNode|AbstractASTArtifact $node |
||
96 | * |
||
97 | * @return float |
||
98 | */ |
||
99 | 4 | private function calculateNameToCommentSimilarityInPercent($node) |
|
115 | |||
116 | /** |
||
117 | * @param string $docComment |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 4 | private function getCommentDescription($docComment) |
|
135 | |||
136 | /** |
||
137 | * @param array $descriptionLines |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | 4 | private function transformDescriptionLines(array $descriptionLines) |
|
151 | |||
152 | /** |
||
153 | * @param string $string |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | 4 | private function transformString($string) |
|
164 | } |
||
165 |
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: