Code Duplication    Length = 12-13 lines in 2 locations

src/POData/ObjectModel/ObjectModelSerializerBase.php 1 location

@@ 582-593 (lines=12) @@
579
     * 
580
     * @throws InvalidOperationException If found un-balanced call with _pushSegment
581
     */
582
    protected function popSegment($needPop)
583
    {
584
        if ($needPop) {
585
            if (!empty($this->_segmentNames)) {
586
                array_pop($this->_segmentNames);
587
                array_pop($this->_segmentResourceSetWrappers);
588
                array_pop($this->_segmentResultCounts);
589
            } else {
590
                throw new InvalidOperationException('Found non-balanced call to _pushSegment and popSegment');
591
            }
592
        }
593
    }
594
595
    /**
596
     * Recursive metod to build $expand and $select paths for a specified node.

src/POData/UriProcessor/UriProcessor.php 1 location

@@ 699-711 (lines=13) @@
696
     * @throws InvalidOperationException If found un-balanced call 
697
     *                                   with _pushSegment
698
     */
699
    private function _popSegment($needPop)
700
    {
701
        if ($needPop) {
702
            if (!empty($this->_segmentNames)) {
703
                array_pop($this->_segmentNames);
704
                array_pop($this->_segmentResourceSetWrappers);
705
            } else {
706
                throw new InvalidOperationException(
707
                    'Found non-balanced call to _pushSegment and popSegment'
708
                );
709
            }
710
        }
711
    }
712
    
713
    /**
714
     * Assert that the given condition is true.