Code Duplication    Length = 13-14 lines in 3 locations

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

@@ 575-588 (lines=14) @@
572
    ) {
573
        //for null operands only equality operators are allowed
574
        $null = new Null1();
575
        if ($leftArgument->typeIs($null) || $rightArgument->typeIs($null)) {
576
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0)
577
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
578
            ) {
579
                throw ODataException::createSyntaxError(
580
                    Messages::expressionParserOperatorNotSupportNull(
581
                        $expressionToken->Text,
582
                        $expressionToken->Position
583
                    )
584
                );
585
            }
586
587
            return;
588
        }
589
590
        //for guid operands only equality operators are allowed
591
        $guid = new Guid();
@@ 592-604 (lines=13) @@
589
590
        //for guid operands only equality operators are allowed
591
        $guid = new Guid();
592
        if ($leftArgument->typeIs($guid) && $rightArgument->typeIs($guid)) {
593
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0)
594
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
595
            ) {
596
                throw ODataException::createSyntaxError(
597
                    Messages::expressionParserOperatorNotSupportGuid(
598
                        $expressionToken->Text,
599
                        $expressionToken->Position
600
                    )
601
                );
602
            }
603
604
            return;
605
        }
606
607
        //for binary operands only equality operators are allowed
@@ 609-621 (lines=13) @@
606
607
        //for binary operands only equality operators are allowed
608
        $binary = new Binary();
609
        if ($leftArgument->typeIs($binary) && $rightArgument->typeIs($binary)) {
610
            if ((strcmp($expressionToken->Text, ODataConstants::KEYWORD_EQUAL) != 0)
611
                && (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT_EQUAL) != 0)
612
            ) {
613
                throw ODataException::createSyntaxError(
614
                    Messages::expressionParserOperatorNotSupportBinary(
615
                        $expressionToken->Text,
616
                        $expressionToken->Position
617
                    )
618
                );
619
            }
620
621
            return;
622
        }
623
624
        //TODO: eq and ne is valid for 'resource reference'