예제 #1
0
 /**
  * Error creation factory.
  *
  * @param string $msg
  * @param Stmt $stmt
  *
  * @return FatalErrorException
  */
 protected function createError($msg, $stmt)
 {
     return new FatalErrorException($msg, 0, 1, null, $stmt->getLine());
 }
예제 #2
0
파일: NodeVisitor.php 프로젝트: kpocha/Sami
 protected function addClassOrInterface(StmtNode $node)
 {
     $class = new ClassReflection((string) $node->namespacedName, $node->getLine());
     $class->setModifiers($node->getType());
     $class->setNamespace($this->context->getNamespace());
     $class->setAliases($this->context->getAliases());
     $class->setHash($this->context->getHash());
     $class->setFile($this->context->getFile());
     $comment = $this->context->getDocBlockParser()->parse($node->getDocComment(), $this->context, $class);
     $class->setDocComment($node->getDocComment());
     $class->setShortDesc($comment->getShortDesc());
     $class->setLongDesc($comment->getLongDesc());
     if ($errors = $comment->getErrors()) {
         $class->setErrors($errors);
     } else {
         $class->setTags($comment->getOtherTags());
     }
     if ($this->context->getFilter()->acceptClass($class)) {
         if ($errors) {
             $this->context->addErrors((string) $class, $node->getLine(), $errors);
         }
         $this->context->enterClass($class);
     }
     return $class;
 }
예제 #3
0
 /**
  * Returns the line number where this object starts.
  *
  * @return int
  */
 public function getLinenumber()
 {
     return $this->node->getLine();
 }
예제 #4
0
 protected function runEchoStatementCheck(Stmt $exp, TaintEnvironment $taintEnv)
 {
     $expTaints = $this->getExpressionsTaintValuesForAnalysis($exp->exprs, $taintEnv);
     $this->sinkNodes[$exp->getLine()] = new FunctionSinkNode($exp, $expTaints);
 }