Page MenuHomeWickedGov Phorge

InferPureVisitorTrait.php
No OneTemporary

Size
858 B
Referenced Files
None
Subscribers
None

InferPureVisitorTrait.php

<?php
declare(strict_types=1);
namespace Phan\AST;
use ast\Node;
use Phan\Exception\NodeException;
/**
* Contains methods to reduce boilerplate
*/
trait InferPureVisitorTrait
{
/**
* Throws NodeException unconditionally
* @return never
* @throws NodeException
* @suppress PhanUnreferencedPublicMethod https://github.com/phan/phan/issues/4558
*/
public function throwNodeException(Node $node): void
{
throw new NodeException($node);
}
/**
* Calls on all child nodes on $node that are instances of Node.
*/
public function maybeInvokeAllChildNodes(Node $node): void
{
foreach ($node->children as $c) {
if ($c instanceof Node) {
// @phan-suppress-next-line PhanUndeclaredMethod
$this->__invoke($c);
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 23, 12:31 (5 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
36/77/1034e2f2b76e7c2c5355d6cdd5ab
Default Alt Text
InferPureVisitorTrait.php (858 B)

Event Timeline