Exakat\Analyzer\Structures\UselessUnset::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        // unset on arguments, reference or value
        $this->atomFunctionIs('\\unset')->outIs('ARGUMENTS')->outIs('ARGUMENT')->atomIs('Variable')->analyzerIs('Variables/Arguments')->back('first');
        $this->prepareQuery();
        // unset on global
        $this->atomFunctionIs('\\unset')->outIs('ARGUMENTS')->outIs('ARGUMENT')->atomIs('Variable')->savePropertyAs('code', 'varname')->goToFunction()->outIs('BLOCK')->atomInside('Global')->outIs('GLOBAL')->samePropertyAs('code', 'varname')->back('first');
        $this->prepareQuery();
        // unset on static
        $this->atomFunctionIs('\\unset')->outIs('ARGUMENTS')->outIs('ARGUMENT')->atomIs('Variable')->savePropertyAs('code', 'varname')->goToFunction()->outIs('BLOCK')->atomInside('Static')->outIs('STATIC')->samePropertyAs('code', 'varname')->back('first');
        $this->prepareQuery();
        // unset on foreach  (variable or property)
        $this->atomIs('Foreach')->outIs('VALUE')->outIsIE('OBJECT')->savePropertyAs('code', 'varname')->inIsIE('OBJECT')->inIs('VALUE')->outIs('BLOCK')->atomInside('Functioncall')->functioncallIs('\\unset')->_as('result')->outIs('ARGUMENTS')->outIs('ARGUMENT')->outIsIE('OBJECT')->samePropertyAs('code', 'varname')->inIsIE('OBJECT')->raw('where( out("OBJECT").hasLabel("Property").count().is(eq(0)) )')->back('result');
        $this->prepareQuery();
        // unset on foreach (KeyVal)
        $this->atomIs('Foreach')->outIs('VALUE')->atomIs('Keyvalue')->outIs('VALUE')->outIsIE('OBJECT')->savePropertyAs('code', 'varname')->inIsIE('OBJECT')->inIs('VALUE')->inIs('VALUE')->outIs('BLOCK')->atomInside('Functioncall')->functioncallIs('\\unset')->_as('result')->outIs('ARGUMENTS')->outIs('ARGUMENT')->outIsIE('OBJECT')->samePropertyAs('code', 'varname')->inIsIE('OBJECT')->raw('where( out("OBJECT").hasLabel("Property").count().is(eq(0)) )')->back('result');
        $this->prepareQuery();
        // unset on foreach (KeyVal)
        $this->atomIs('Foreach')->outIs('VALUE')->outIsIE('VALUE')->atomIs('Property')->savePropertyAs('fullcode', 'varname')->inIsIE('VALUE')->outIs('BLOCK')->atomFunctionIs('\\unset')->_as('result')->outIs('ARGUMENTS')->outIs('ARGUMENT')->samePropertyAs('fullcode', 'varname')->back('result');
        $this->prepareQuery();
        // unset as operator
        // unset on arguments, reference or value
        $this->atomIs('Cast')->tokenIs('T_UNSET_CAST')->outIs('CAST')->atomIs('Variable')->analyzerIs('Variables/Arguments')->back('first');
        $this->prepareQuery();
        // unset on global
        $this->atomIs('Cast')->tokenIs('T_UNSET_CAST')->outIs('CAST')->atomIs('Variable')->savePropertyAs('code', 'varname')->goToFunction()->outIs('BLOCK')->atomInside('Global')->outIs('GLOBAL')->samePropertyAs('code', 'varname')->back('first');
        $this->prepareQuery();
        // unset on static
        $this->atomIs('Cast')->tokenIs('T_UNSET_CAST')->outIs('CAST')->atomIs('Variable')->savePropertyAs('code', 'varname')->goToFunction()->outIs('BLOCK')->atomInside('Static')->outIs('STATIC')->samePropertyAs('code', 'varname')->back('first');
        $this->prepareQuery();
        // unset on foreach (variable)
        $this->atomIs('Foreach')->outIs('VALUE')->atomIs('Variable')->savePropertyAs('code', 'varname')->inIs('VALUE')->outIs('BLOCK')->atomInside('Cast')->tokenIs('T_UNSET_CAST')->_as('result')->outIs('CAST')->samePropertyAs('code', 'varname')->back('result');
        $this->prepareQuery();
        // unset on foreach (KeyVal)
        $this->atomIs('Foreach')->outIs('VALUE')->atomIs('Keyvalue')->outIs('VALUE')->savePropertyAs('code', 'varname')->inIs('VALUE')->inIs('VALUE')->outIs('BLOCK')->atomInside('Cast')->tokenIs('T_UNSET_CAST')->_as('result')->outIs('CAST')->samePropertyAs('code', 'varname')->back('result');
        $this->prepareQuery();
    }