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

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