Code Duplication    Length = 6-9 lines in 2 locations

src/HTTPRequestTrait.php 1 location

@@ 48-53 (lines=6) @@
45
					$headers['Content-type'] = 'application/x-www-form-urlencoded';
46
				}
47
48
				if($headers['Content-type'] === 'application/x-www-form-urlencoded'){
49
					$body = http_build_query($body, '', '&', PHP_QUERY_RFC1738);
50
				}
51
				elseif($headers['Content-type'] === 'application/json'){
52
					$body = json_encode($body);
53
				}
54
55
			}
56

src/MagicAPI/ApiClientTrait.php 1 location

@@ 118-126 (lines=9) @@
115
					$headers['Content-type'] = 'application/x-www-form-urlencoded';
116
				}
117
118
				if($headers['Content-type'] === 'application/x-www-form-urlencoded'){
119
					$body = http_build_query($body, '', '&', PHP_QUERY_RFC1738);
120
				}
121
				elseif($headers['Content-type'] === 'application/json'){
122
					$body = json_encode($body);
123
				}
124
				else{
125
					$body = null; // @todo
126
				}
127
128
			}
129