Code Duplication    Length = 12-13 lines in 2 locations

src/POData/ObjectModel/ObjectModelSerializerBase.php 1 location

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

src/POData/UriProcessor/UriProcessor.php 1 location

@@ 822-834 (lines=13) @@
819
     * @throws InvalidOperationException If found un-balanced call
820
     *                                   with _pushSegment
821
     */
822
    private function _popSegment($needPop)
823
    {
824
        if ($needPop) {
825
            if (!empty($this->_segmentNames)) {
826
                array_pop($this->_segmentNames);
827
                array_pop($this->_segmentResourceSetWrappers);
828
            } else {
829
                throw new InvalidOperationException(
830
                    'Found non-balanced call to _pushSegment and popSegment'
831
                );
832
            }
833
        }
834
    }
835
836
    /**
837
     * Assert that the given condition is true.