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

analyze() public method

public analyze ( )
    public function analyze()
    {
        // Empty block
        $this->atomIs(array('Switch', 'For', 'While', 'Foreach', 'Declare'))->outIs(array('CASES', 'BLOCK'))->hasNoOut('ELEMENT')->back('first');
        $this->prepareQuery();
        // Empty block on ifthen
        $this->atomIs('Ifthen')->outIs(array('THEN', 'ELSE'))->hasNoOut(array('ELEMENT', 'CONDITION'))->back('first')->inIsIE('ELSE');
        $this->prepareQuery();
        // Block with only one empty expression
        // Block with only empty expressions
        $this->atomIs(array('For', 'While', 'Foreach', 'Dowhile', 'Declare', 'Namespace', 'Declare'))->outIs('BLOCK')->raw('where( __.out("ELEMENT").not( hasLabel("Void")).count().is(eq(0)) )')->back('first');
        $this->prepareQuery();
        // Empty block on ifthen
        $this->atomIs('Ifthen')->outIs(array('THEN', 'ELSE'))->raw('where( __.out("ELEMENT", "CONDITION").not( hasLabel("Void")).count().is(eq(0)) )')->back('first')->inIsIE('ELSE');
        $this->prepareQuery();
    }
EmptyBlocks