> */ public function getNodeTypes() : array { return [New_::class]; } /** * @param New_ $node */ public function refactor(Node $node) : ?Node { foreach ($this->typeToStaticCalls as $typeToStaticCall) { if (!$this->isObjectType($node->class, $typeToStaticCall->getObjectType())) { continue; } return $this->nodeFactory->createStaticCall($typeToStaticCall->getStaticCallClass(), $typeToStaticCall->getStaticCallMethod(), $node->args); } return null; } /** * @param mixed[] $configuration */ public function configure(array $configuration) : void { Assert::allIsAOf($configuration, NewToStaticCall::class); $this->typeToStaticCalls = $configuration; } }