Code Duplication    Length = 22-24 lines in 2 locations

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

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

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}.