1 | <?php |
||
14 | class AddUseStmts extends NodeVisitorAbstract |
||
15 | { |
||
16 | /** @var array */ |
||
17 | private $useStmts = []; |
||
18 | |||
19 | public function __construct(array $useStmts) |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function leaveNode(Node $node) |
||
36 | |||
37 | private function definePlacementID(Node\Stmt\Namespace_ $node): int |
||
47 | |||
48 | /** |
||
49 | * @param Node\Stmt[] $stmts |
||
50 | * @param Node\Stmt\Use_[] $nodes |
||
51 | * |
||
52 | * @return Node\Stmt\Use_[] |
||
53 | */ |
||
54 | private function removeDuplicates(array $stmts, array $nodes): array |
||
72 | |||
73 | /** |
||
74 | * @param Node\Stmt[] $stmts |
||
75 | * |
||
76 | * @return string[] |
||
77 | */ |
||
78 | private function getExistingUseParts(array $stmts): array |
||
93 | |||
94 | /** |
||
95 | * @return Node[] |
||
96 | */ |
||
97 | private function buildUseStmts(): array |
||
106 | |||
107 | /** |
||
108 | * @param string $type |
||
109 | * |
||
110 | * @return Node |
||
111 | */ |
||
112 | private function buildUseStmt(string $type): Node |
||
118 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: