Exakat\Analyzer\Structures\UnsetInForeach::analyze PHP Метод

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

public analyze ( )
    public function analyze()
    {
        // foreach($a as $v) { unset($v); }
        // Only valid : Objects (unset on properties) or arrays (if the blind variable is reference)
        $this->atomIs('Foreach')->outIs('VALUE')->outIsIE(array('KEY', 'VALUE'))->atomIs('Variable')->savePropertyAs('code', 'blind')->savePropertyAs('reference', 'reference')->back('first')->outIs('BLOCK')->atomInside('Functioncall')->tokenIs('T_UNSET')->outIs('ARGUMENTS')->outIs('ARGUMENT')->outIsIE(array('VARIABLE', 'OBJECT'))->samePropertyAs('code', 'blind')->inIsIE(array('VARIABLE', 'OBJECT'))->atomIsNot('Property')->raw('filter{ !(it.get().label() == "Array" && reference == true) }')->back('first');
        $this->prepareQuery();
        ////////////////////////////////////////////////////////////
        // same but with (unset) instead of unset()
        ////////////////////////////////////////////////////////////
        $this->atomIs('Foreach')->outIs('VALUE')->outIsIE(array('KEY', 'VALUE'))->atomIs('Variable')->savePropertyAs('code', 'blind')->savePropertyAs('reference', 'reference')->back('first')->outIs('BLOCK')->atomInside('Cast')->tokenIs('T_UNSET_CAST')->outIs('CAST')->outIsIE(array('VARIABLE', 'OBJECT'))->samePropertyAs('code', 'blind')->inIsIE(array('VARIABLE', 'OBJECT'))->atomIsNot('Property')->raw('filter{ !(it.get().label() == "Array" && reference == true) }')->back('first');
        $this->prepareQuery();
    }
UnsetInForeach