Code Duplication    Length = 4-4 lines in 2 locations

lib/Elastica/Transport/Guzzle.php 1 location

@@ 135-138 (lines=4) @@
132
                $req = $req->withMethod(Request::POST);
133
            }
134
135
            if ($this->hasParam('postWithRequestBody') && true == $this->getParam('postWithRequestBody')) {
136
                $request->setMethod(Request::POST);
137
                $req = $req->withMethod(Request::POST);
138
            }
139
140
            $req = $req->withBody(
141
                Psr7\stream_for(is_array($data)

lib/Elastica/Transport/HttpAdapter.php 1 location

@@ 117-120 (lines=4) @@
114
                $method = ElasticaRequest::POST;
115
            }
116
117
            if ($this->hasParam('postWithRequestBody') && true == $this->getParam('postWithRequestBody')) {
118
                $elasticaRequest->setMethod(ElasticaRequest::POST);
119
                $method = ElasticaRequest::POST;
120
            }
121
122
            if (is_array($data)) {
123
                $body = JSON::stringify($data, JSON_UNESCAPED_UNICODE);