Code Duplication    Length = 22-24 lines in 2 locations

eZ/Publish/Core/REST/Client/ContentTypeService.php 1 location

@@ 137-158 (lines=22) @@
134
    /**
135
     * {@inheritdoc}
136
     */
137
    public function loadContentTypeGroupByIdentifier($contentTypeGroupIdentifier, array $prioritizedLanguages = [])
138
    {
139
        $response = $this->client->request(
140
            'GET',
141
            $this->requestParser->generate('typegroupByIdentifier', array('typegroup' => $contentTypeGroupIdentifier)),
142
            new Message(
143
                array('Accept' => $this->outputVisitor->getMediaType('ContentTypeGroupList'))
144
            )
145
        );
146
147
        if ($response->statusCode == 307) {
148
            $response = $this->client->request(
149
                'GET',
150
                $response->headers['Location'],
151
                new Message(
152
                    array('Accept' => $this->outputVisitor->getMediaType('ContentTypeGroup'))
153
                )
154
            );
155
        }
156
157
        return $this->inputDispatcher->parse($response);
158
    }
159
160
    /**
161
     * {@inheritdoc}

eZ/Publish/Core/REST/Client/ContentService.php 1 location

@@ 129-152 (lines=24) @@
126
     *
127
     * @return \eZ\Publish\API\Repository\Values\Content\ContentInfo
128
     */
129
    public function loadContentInfoByRemoteId($remoteId)
130
    {
131
        $response = $this->client->request(
132
            'GET',
133
            $this->requestParser->generate('objectByRemote', array('object' => $remoteId)),
134
            new Message(
135
                array('Accept' => $this->outputVisitor->getMediaType('ContentInfo'))
136
            )
137
        );
138
139
        if ($response->statusCode == 307) {
140
            $response = $this->client->request(
141
                'GET',
142
                $response->headers['Location'],
143
                new Message(
144
                    array('Accept' => $this->outputVisitor->getMediaType('ContentInfo'))
145
                )
146
            );
147
        }
148
149
        $restContentInfo = $this->inputDispatcher->parse($response);
150
151
        return $this->completeContentInfo($restContentInfo);
152
    }
153
154
    /**
155
     * Returns a complete ContentInfo based on $restContentInfo.