Psecio\Parse\Scanner::onNodeFailure PHP Method

onNodeFailure() public method

Node fail callback
public onNodeFailure ( Psecio\Parse\RuleInterface $rule, PhpParser\Node $node, Psecio\Parse\File $file ) : void
$rule Psecio\Parse\RuleInterface
$node PhpParser\Node
$file Psecio\Parse\File
return void
    public function onNodeFailure(RuleInterface $rule, Node $node, File $file)
    {
        $this->dispatcher->dispatch(self::FILE_ISSUE, new Event\IssueEvent($rule, $node, $file));
    }

Usage Example

Ejemplo n.º 1
0
 public function testCallbackOnIssue()
 {
     $dispatcher = m::mock('\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->shouldReceive('dispatch')->once()->with(Scanner::FILE_ISSUE, m::type('\\Psecio\\Parse\\Event\\IssueEvent'))->mock();
     $scanner = new Scanner($dispatcher, m::mock('\\Psecio\\Parse\\CallbackVisitor')->shouldReceive('onNodeFailure')->mock());
     $scanner->onNodeFailure(m::mock('\\Psecio\\Parse\\RuleInterface'), m::mock('\\PhpParser\\Node'), m::mock('\\Psecio\\Parse\\File'));
 }