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

analyze() public method

public analyze ( )
    public function analyze()
    {
        // Check that fullcode is the same or not
        $this->atomIs('Switch')->raw('where( __.sideEffect{ counts = [:]; }
                             .out("CASES").out("ELEMENT").hasLabel("Case").out("CASE")
                             .sideEffect{ k = it.get().value("fullcode"); if (counts[k] == null) { counts[k] = 1; } else { counts[k]++; }}
                             .map{ counts.findAll{it.value > 1}; }.unfold().count().is(neq(0))
                              )');
        $this->prepareQuery();
        // Special case for strings (avoiding ' and ")
        $this->atomIs('Switch')->raw('where( __.sideEffect{ counts = [:]; }
                             .out("CASES").out("ELEMENT").hasLabel("Case").out("CASE").hasLabel("String").where( __.out("CONCAT").count().is(eq(0)) )
                             .sideEffect{ k = it.get().value("noDelimiter"); if (counts[k] == null) { counts[k] = 1; } else { counts[k]++; }}
                             .map{ counts.findAll{it.value > 1}; }.unfold().count().is(neq(0))
                              )');
        $this->prepareQuery();
        // Special case for mix of strings and constants
    }
MultipleDefinedCase