> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if ($node->name instanceof Expr) { return null; } $hasChanged = \false; foreach ($this->removedFunctionArguments as $removedFunctionArgument) { if (!$this->isName($node->name, $removedFunctionArgument->getFunction())) { continue; } foreach (\array_keys($node->args) as $position) { if ($removedFunctionArgument->getArgumentPosition() !== $position) { continue; } unset($node->args[$position]); $hasChanged = \true; } } if (!$hasChanged) { return null; } return $node; } /** * @param mixed[] $configuration */ public function configure(array $configuration) : void { Assert::allIsAOf($configuration, RemoveFuncCallArg::class); $this->removedFunctionArguments = $configuration; } }