| @@ 824-836 (lines=13) @@ | ||
| 821 | * @throws InvalidOperationException If found un-balanced call |
|
| 822 | * with _pushSegment |
|
| 823 | */ |
|
| 824 | private function _popSegment($needPop) |
|
| 825 | { |
|
| 826 | if ($needPop) { |
|
| 827 | if (!empty($this->_segmentNames)) { |
|
| 828 | array_pop($this->_segmentNames); |
|
| 829 | array_pop($this->_segmentResourceSetWrappers); |
|
| 830 | } else { |
|
| 831 | throw new InvalidOperationException( |
|
| 832 | 'Found non-balanced call to _pushSegment and popSegment' |
|
| 833 | ); |
|
| 834 | } |
|
| 835 | } |
|
| 836 | } |
|
| 837 | ||
| 838 | /** |
|
| 839 | * Assert that the given condition is true. |
|
| @@ 585-596 (lines=12) @@ | ||
| 582 | * |
|
| 583 | * @throws InvalidOperationException If found un-balanced call with _pushSegment |
|
| 584 | */ |
|
| 585 | protected function popSegment($needPop) |
|
| 586 | { |
|
| 587 | if ($needPop) { |
|
| 588 | if (!empty($this->_segmentNames)) { |
|
| 589 | array_pop($this->_segmentNames); |
|
| 590 | array_pop($this->_segmentResourceSetWrappers); |
|
| 591 | array_pop($this->_segmentResultCounts); |
|
| 592 | } else { |
|
| 593 | throw new InvalidOperationException('Found non-balanced call to _pushSegment and popSegment'); |
|
| 594 | } |
|
| 595 | } |
|
| 596 | } |
|
| 597 | ||
| 598 | /** |
|
| 599 | * Recursive metod to build $expand and $select paths for a specified node. |
|