traverse() public méthode

public traverse ( array $nodes, Sstalle\php7cc\CompatibilityViolation\ContextInterface $context = null, array $tokens = [] )
$nodes array
$context Sstalle\php7cc\CompatibilityViolation\ContextInterface
$tokens array
Exemple #1
0
 /**
  * @param ContextInterface $context
  *
  * @return FileContext
  */
 public function checkContext(ContextInterface $context)
 {
     try {
         $parsedStatements = $this->parser->parse($context->getCheckedCode());
         $this->traverser->traverse($parsedStatements, $context, $this->lexer->getTokens());
     } catch (\Exception $e) {
         $context->addError(new CheckError($e->getMessage()));
     } catch (\ParseException $e) {
         $context->addError(new CheckError($e->getMessage(), $e->getLine()));
     }
 }
Exemple #2
0
 /**
  * @param ContextInterface $context
  * @return FileContext
  */
 public function checkContext(ContextInterface $context)
 {
     $parsedStatements = $this->parser->parse($context->getCheckedCode());
     $this->traverser->traverse($parsedStatements, $context, $this->lexer->getTokens());
 }