> */ public function getNodeTypes() : array { return [\PhpParser\Node\Expr\FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node { if (!$this->isName($node, 'sprintf')) { return null; } if (\count($node->args) !== 2) { return null; } $maskArgument = $node->args[0]->value; if (!$maskArgument instanceof \PhpParser\Node\Scalar\String_) { return null; } if ($maskArgument->value !== '%s') { return null; } $valueArgument = $node->args[1]->value; if (!$this->nodeTypeResolver->isStaticType($valueArgument, \PHPStan\Type\StringType::class)) { return null; } return $valueArgument; } }