protected function reportArgument(Expr $arg) { if ($arg instanceof BinaryOp) { $this->reportArgument($arg->left); $this->reportArgument($arg->right); } elseif ($arg instanceof Encapsed) { foreach ($arg->parts as $part) { if ($part instanceof Variable) { $this->reportArgument($part); } } } elseif ($arg instanceof Variable) { $warn = "Translatable text contains variable '{$arg->name}' on line {$arg->getLine()}, consider using literal string instead."; $this->output->writeln("<comment>{$warn}</comment>"); } }
protected function runSinkExpressionCheck(Expr $exp) { $expTaint = $this->resolveExprTaint($exp->expr); $this->sinkNodes[$exp->getLine()] = new FunctionSinkNode($exp, array($expTaint)); }