Вход Регистрация
Файл: gapps/vendor/jeremeamia/SuperClosure/src/Analyzer/Visitor/ThisDetectorVisitor.php
Строк: 17
<?php namespace SuperClosureAnalyzerVisitor;

use 
PhpParserNode as AstNode;
use 
PhpParserNodeExprVariable as VariableNode;
use 
PhpParserNodeVisitorAbstract as NodeVisitor;

/**
 * Detects if the closure's AST contains a $this variable.
 *
 * @internal
 */
final class ThisDetectorVisitor extends NodeVisitor
{
    
/**
     * @var bool
     */
    
public $detected false;

    public function 
leaveNode(AstNode $node)
    {
        if (
$node instanceof VariableNode) {
            if (
$node->name === 'this') {
                
$this->detected true;
            }
        }
    }
}
Онлайн: 0
Реклама