Psecio\Parse\Rule\RuleTestCase::scan PHP Method

scan() protected method

Scan PHP code and return the result
protected scan ( string $code ) : boolean
$code string The code to scan
return boolean The results visiting all the nodes from the parsed $code
    protected function scan($code)
    {
        $visitor = new RuleTestVisitor($this->buildTest());
        $traverser = new NodeTraverser();
        $traverser->addVisitor($visitor);
        $traverser->traverse($this->parser->parse('<?php ' . $code));
        return $visitor->result;
    }