Exakat\Analyzer\Classes\NonStaticMethodsCalledStatic::analyze PHP Метод

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

public analyze ( )
    public function analyze()
    {
        // check outside the class : the first found class has the method, and it is not static
        $this->atomIs('Staticmethodcall')->analyzerIs('Classes/IsNotFamily')->outIs('METHOD')->tokenIs('T_STRING')->codeIsNot('__construct')->savePropertyAs('code', 'methodname')->inIs('METHOD')->outIs('CLASS')->codeIsNot(array('self', 'parent', 'static'))->classDefinition()->outIs('BLOCK')->outIs('ELEMENT')->atomIs('Function')->hasNoOut('STATIC')->outIs('NAME')->samePropertyAs('code', 'methodname')->back('first');
        $this->prepareQuery();
        // check outside the class to undefined Class : report it as pb.
        $this->atomIs('Staticmethodcall')->analyzerIs('Classes/UndefinedClasses')->back('first');
        $this->prepareQuery();
        // check outside the class : the first found class has not method
        // Here, we find methods that are in the grand parents, and not static.
        // Current class
        $this->atomIs('Staticmethodcall')->outIs('METHOD')->tokenIs('T_STRING')->codeIsNot('__construct')->savePropertyAs('code', 'methodname')->inIs('METHOD')->outIs('CLASS')->classDefinition()->outIs('BLOCK')->outIs('ELEMENT')->atomIs('Function')->hasNoOut('STATIC')->outIs('NAME')->samePropertyAs('code', 'methodname')->back('first');
        $this->prepareQuery();
        // Go to all parents class
        $this->atomIs('Staticmethodcall')->analyzerIs('Classes/IsNotFamily')->outIs('METHOD')->tokenIs('T_STRING')->codeIsNot('__construct')->savePropertyAs('code', 'methodname')->inIs('METHOD')->outIs('CLASS')->codeIsNot(array('parent', 'self', 'static'))->classDefinition()->goToAllParents()->outIs('BLOCK')->outIs('ELEMENT')->atomIs('Function')->hasNoOut('STATIC')->outIs('NAME')->samePropertyAs('code', 'methodname')->back('first');
        $this->prepareQuery();
    }
NonStaticMethodsCalledStatic