Code Duplication    Length = 7-9 lines in 2 locations

src/POData/ObjectModel/ObjectModelSerializer.php 2 locations

@@ 50-56 (lines=7) @@
47
    {
48
        $requestTargetSource = $this->getRequest()->getTargetSource();
49
50
        if ($requestTargetSource == TargetSource::ENTITY_SET) {
51
            $resourceType = $this->getRequest()->getTargetResourceType();
52
        } else {
53
            assert($requestTargetSource == TargetSource::PROPERTY, '$requestTargetSource != TargetSource::PROPERTY');
54
            $resourceProperty = $this->getRequest()->getProjectedProperty();
55
            $resourceType = $resourceProperty->getResourceType();
56
        }
57
58
        $needPop = $this->pushSegmentForRoot();
59
        $entry = $this->_writeEntryElement(
@@ 83-91 (lines=9) @@
80
        $requestTargetSource = $this->getRequest()->getTargetSource();
81
        if ($requestTargetSource == TargetSource::ENTITY_SET) {
82
            $title = $this->getRequest()->getContainerName();
83
        } else {
84
            assert($requestTargetSource == TargetSource::PROPERTY, '$requestTargetSource != TargetSource::PROPERTY');
85
            $resourceProperty = $this->getRequest()->getProjectedProperty();
86
            assert(
87
                $resourceProperty->getKind() == ResourcePropertyKind::RESOURCESET_REFERENCE,
88
                '$resourceProperty->getKind() != ResourcePropertyKind::RESOURCESET_REFERENCE'
89
            );
90
            $title = $resourceProperty->getName();
91
        }
92
93
        $relativeUri = $this->getRequest()->getIdentifier();
94
        $feed = new ODataFeed();