Code Duplication    Length = 7-7 lines in 2 locations

src/RequestLocation/FormParamLocation.php 1 location

@@ 69-75 (lines=7) @@
66
67
        // Add additional parameters to the form_params array
68
        $additional = $operation->getAdditionalParameters();
69
        if ($additional && $additional->getLocation() == $this->locationName) {
70
            foreach ($command->toArray() as $key => $value) {
71
                if (!$operation->hasParam($key)) {
72
                    $data['form_params'][$key] = $this->prepareValue($value, $additional);
73
                }
74
            }
75
        }
76
77
        $body = http_build_query($data['form_params'], '', '&');
78
        $modify['body'] = Psr7\stream_for($body);

src/RequestLocation/JsonLocation.php 1 location

@@ 70-76 (lines=7) @@
67
68
        // Add additional parameters to the JSON document
69
        $additional = $operation->getAdditionalParameters();
70
        if ($additional && ($additional->getLocation() === $this->locationName)) {
71
            foreach ($command->toArray() as $key => $value) {
72
                if (!$operation->hasParam($key)) {
73
                    $data[$key] = $this->prepareValue($value, $additional);
74
                }
75
            }
76
        }
77
78
        // Don't overwrite the Content-Type if one is set
79
        if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {