Code Duplication    Length = 13-14 lines in 3 locations

src/POData/UriProcessor/QueryProcessor/FunctionDescription.php 3 locations

@@ 555-568 (lines=14) @@
552
    ) {
553
        //for null operands only equality operators are allowed
554
        $null = new Null1();
555
        if ($leftArgument->typeIs($null) || $rightArgument->typeIs($null)) {
556
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0) 
557
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
558
            ) {                
559
                throw ODataException::createSyntaxError(
560
                    Messages::expressionParserOperatorNotSupportNull(
561
                        $expressionToken->Text, 
562
                        $expressionToken->Position
563
                    )
564
                );
565
            }
566
567
            return;
568
        }
569
570
        //for guid operands only equality operators are allowed
571
        $guid = new Guid();
@@ 572-584 (lines=13) @@
569
570
        //for guid operands only equality operators are allowed
571
        $guid = new Guid();
572
        if ($leftArgument->typeIs($guid) && $rightArgument->typeIs($guid)) {
573
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0) 
574
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
575
            ) {                
576
                throw ODataException::createSyntaxError(
577
                    Messages::expressionParserOperatorNotSupportGuid(
578
                        $expressionToken->Text, $expressionToken->Position
579
                    )
580
                );
581
            }
582
583
            return;
584
        }       
585
        
586
        //for binary operands only equality operators are allowed
587
        $binary = new Binary();
@@ 588-600 (lines=13) @@
585
        
586
        //for binary operands only equality operators are allowed
587
        $binary = new Binary();
588
        if ($leftArgument->typeIs($binary) && $rightArgument->typeIs($binary)) {
589
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0) 
590
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
591
            ) {                
592
                throw ODataException::createSyntaxError(
593
                    Messages::expressionParserOperatorNotSupportBinary(
594
                        $expressionToken->Text, $expressionToken->Position
595
                    )
596
                );
597
            }
598
599
            return;
600
        }
601
        
602
        //TODO: eq and ne is valid for 'resource reference' 
603
        //navigation also verify here