Exakat\Analyzer\Traits\DependantTrait::analyze PHP Метод

analyze() публичный Метод

public analyze ( )
    public function analyze()
    {
        // Case for $this->method()
        $this->atomIs('Trait')->outIs('BLOCK')->atomInside('Methodcall')->outIs('OBJECT')->atomIs('Variable')->codeIs('$this')->inIs('OBJECT')->outIs('METHOD')->tokenIs('T_STRING')->savePropertyAs('code', 'method')->goToTrait()->raw('where( __.emit(hasLabel("Trait")).repeat( out("BLOCK").out("ELEMENT").hasLabel("Use").out("USE").in("DEFINITION") ).times(' . self::MAX_LOOPING . ')
                             .out("BLOCK").out("ELEMENT").hasLabel("Function").out("NAME").filter{ it.get().value("code") == method }.count().is(eq(0)) )')->back('first');
        $this->prepareQuery();
        // Case for $this->$properties
        $this->atomIs('Trait')->outIs('BLOCK')->atomInside('Property')->outIs('OBJECT')->atomIs('Variable')->codeIs('$this')->inIs('OBJECT')->outIs('PROPERTY')->outIsIE('VARIABLE')->tokenIs('T_STRING')->savePropertyAs('code', 'property')->goToTrait()->raw('where( __.emit(hasLabel("Trait")).repeat( out("BLOCK").out("ELEMENT").hasLabel("Use").out("USE").in("DEFINITION") ).times(' . self::MAX_LOOPING . ')
                             .out("BLOCK").out("ELEMENT").hasLabel("Ppp").out("PPP").filter{ it.get().value("propertyname") == property }.count().is(eq(0)) )')->back('first');
        $this->prepareQuery();
        // Case for class::$properties
        $this->atomIs('Trait')->savePropertyAs('fullnspath', 'fnp')->outIs('BLOCK')->atomInside('Staticproperty')->outIs('CLASS')->samePropertyAs('fullnspath', 'fnp')->inIs('CLASS')->outIs('PROPERTY')->tokenIs('T_VARIABLE')->savePropertyAs('code', 'property')->goToTrait()->raw('where( __.emit(hasLabel("Trait")).repeat( out("BLOCK").out("ELEMENT").hasLabel("Use").out("USE").in("DEFINITION") ).times(' . self::MAX_LOOPING . ')
                             .out("BLOCK").out("ELEMENT").hasLabel("Ppp").out("PPP").coalesce(__.out("LEFT"), __.filter{ true }).filter{ it.get().value("code") == property }.count().is(eq(0)) )')->back('first');
        $this->prepareQuery();
        // Case for class::methodcall
        $this->atomIs('Trait')->savePropertyAs('fullnspath', 'fnp')->outIs('BLOCK')->atomInside('Staticmethodcall')->outIs('CLASS')->samePropertyAs('fullnspath', 'fnp')->inIs('CLASS')->outIs('METHOD')->tokenIs('T_STRING')->savePropertyAs('code', 'method')->goToTrait()->raw('where( __.emit(hasLabel("Trait")).repeat( out("BLOCK").out("ELEMENT").hasLabel("Use").out("USE").in("DEFINITION") ).times(' . self::MAX_LOOPING . ')
                             .out("BLOCK").out("ELEMENT").hasLabel("Function").out("NAME").filter{ it.get().value("code") == method }.count().is(eq(0)) )')->back('first');
        $this->prepareQuery();
        // Case for class::methodcall
    }
DependantTrait