Exakat\Analyzer\Php\ShouldUseCoalesce::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        //isset($a) ? $a : 'b';
        $this->atomIs('Ternary')->outIs('CONDITION')->functioncallIs('\\isset')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->savePropertyAs('fullcode', 'variable')->inIs('ARGUMENT')->inIs('ARGUMENTS')->inIs('CONDITION')->outIs('THEN')->samePropertyAs('fullcode', 'variable')->back('first');
        $this->prepareQuery();
        //!isset($a) ? 'b' : $a;
        $this->atomIs('Ternary')->outIs('CONDITION')->atomIs('Not')->outIs('NOT')->functioncallIs('\\isset')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->savePropertyAs('fullcode', 'variable')->inIs('ARGUMENT')->inIs('ARGUMENTS')->inIs('NOT')->inIs('CONDITION')->outIs('ELSE')->samePropertyAs('fullcode', 'variable')->back('first');
        $this->prepareQuery();
        //$a === null ? $a : 'b';
        $this->atomIs('Ternary')->outIs('CONDITION')->atomIs('Comparison')->codeIs('===')->outIs(array('LEFT', 'RIGHT'))->atomIs('Null')->inIs(array('LEFT', 'RIGHT'))->outIs(array('LEFT', 'RIGHT'))->savePropertyAs('fullcode', 'variable')->inIs(array('LEFT', 'RIGHT'))->inIs('CONDITION')->outIs('THEN')->samePropertyAs('fullcode', 'variable')->back('first');
        $this->prepareQuery();
        //$a !== null ?  'b' : $a;
        $this->atomIs('Ternary')->outIs('CONDITION')->atomIs('Comparison')->codeIs('!==')->outIs(array('LEFT', 'RIGHT'))->atomIs('Null')->inIs(array('LEFT', 'RIGHT'))->outIs(array('LEFT', 'RIGHT'))->tokenIsNot('T_STRING')->savePropertyAs('fullcode', 'variable')->inIs(array('LEFT', 'RIGHT'))->inIs('CONDITION')->outIs('ELSE')->samePropertyAs('fullcode', 'variable')->back('first');
        $this->prepareQuery();
        //if (($model = Model::get($id)) === NULL) { $model = $default_model; }
        $this->atomIs('Ifthen')->outIs('CONDITION')->atomIs('Comparison')->codeIs('===')->outIs(array('LEFT', 'RIGHT'))->atomIs('Null')->inIs(array('LEFT', 'RIGHT'))->outIs(array('LEFT', 'RIGHT'))->outIsIE('CODE')->atomIs('Assignation')->codeIs('=')->outIs('LEFT')->savePropertyAs('fullcode', 'variable')->inIs('LEFT')->inIsIE('CODE')->inIs(array('LEFT', 'RIGHT'))->inIs('CONDITION')->outIs('THEN')->outWithRank('ELEMENT', 0)->outIs('LEFT')->samePropertyAs('fullcode', 'variable')->back('first');
        $this->prepareQuery();
    }
ShouldUseCoalesce