コード例 #1
0
 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>");
     }
 }
コード例 #2
0
 protected function runSinkExpressionCheck(Expr $exp)
 {
     $expTaint = $this->resolveExprTaint($exp->expr);
     $this->sinkNodes[$exp->getLine()] = new FunctionSinkNode($exp, array($expTaint));
 }