Code Duplication    Length = 14-29 lines in 2 locations

src/POData/ObjectModel/ObjectModelSerializerBase.php 1 location

@@ 393-421 (lines=29) @@
390
     *
391
     * @return bool true if the segment was push, false otherwise
392
     */
393
    private function _pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper)
394
    {
395
        $rootProjectionNode = $this->request->getRootProjectionNode();
396
        // Even though there is no expand in the request URI, still we need to push
397
        // the segment information if we need to count
398
        //the number of entities written.
399
        // After serializing each entity we should check the count to see whether
400
        // we serialized more entities than configured
401
        //(page size, maxResultPerCollection).
402
        // But we will not do this check since library is doing paging and never
403
        // accumulate entities more than configured.
404
405
        // if ((!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified())
406
        //    || ($resourceSetWrapper->getResourceSetPageSize() != 0)
407
        //    || ($this->service->getServiceConfiguration()->getMaxResultsPerCollection() != PHP_INT_MAX)
408
        //) {}
409
410
        if (!is_null($rootProjectionNode)
411
            && $rootProjectionNode->isExpansionSpecified()
412
        ) {
413
            array_push($this->_segmentNames, $segmentName);
414
            array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper);
415
            array_push($this->_segmentResultCounts, 0);
416
417
            return true;
418
        }
419
420
        return false;
421
    }
422
423
    /**
424
     * Get next page link from the given entity instance.

src/POData/UriProcessor/UriProcessor.php 1 location

@@ 794-807 (lines=14) @@
791
     *
792
     * @return bool true if the segment was push, false otherwise
793
     */
794
    private function _pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper)
795
    {
796
        $rootProjectionNode = $this->request->getRootProjectionNode();
797
        if (!is_null($rootProjectionNode)
798
            && $rootProjectionNode->isExpansionSpecified()
799
        ) {
800
            array_push($this->_segmentNames, $segmentName);
801
            array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper);
802
803
            return true;
804
        }
805
806
        return false;
807
    }
808
809
    /**
810
     * Pops segment information from the 'Segment Stack'