Skip to content

Commit 46d1c1e

Browse files
committed
:octocat:
1 parent d694896 commit 46d1c1e

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ method | return
4646
`httpPOST(string $url, array $params = null, $body = null, array $headers = null)` | `HTTPResponseInterface`
4747
`httpPUT(string $url, array $params = null, $body = null, array $headers = null)` | `HTTPResponseInterface`
4848
`normalizeRequestHeaders(array $headers)` | array
49-
`checkQueryParams($params, bool $booleans_as_string = null)` | array
49+
`checkQueryParams($params, bool $booleans_as_string = null)` | mixed
5050
`httpBuildQuery(array $params, bool $urlencode = null, string $delimiter = null, string $enclosure = null)` | string

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"name": "chillerlan/php-httpinterface",
33
"description": "A http client interface for PHP7+",
4-
"minimum-stability": "dev",
54
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"http", "client", "wrapper"
8+
],
9+
"minimum-stability": "stable",
610
"authors": [
711
{
812
"name": "smiley",
@@ -19,7 +23,7 @@
1923
"chillerlan/php-traits": "^1.1"
2024
},
2125
"require-dev": {
22-
"chillerlan/php-curl": "dev-master",
26+
"chillerlan/php-curl": "^1.0",
2327
"guzzlehttp/guzzle": "^6.3",
2428
"phpunit/phpunit": "^6.5"
2529
},

src/HTTPClientAbstract.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ public function normalizeRequestHeaders(array $headers):array {
5656
return $normalized_headers;
5757
}
5858

59-
/**
60-
* @param $data
61-
*
62-
* @return array|string
63-
*/
64-
protected function rawurlencode($data){
59+
/** @inheritdoc */
60+
public function rawurlencode($data){
6561

6662
if(is_array($data)){
6763
return array_map([$this, 'rawurlencode'], $data);

src/HTTPClientInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public function request(string $url, array $params = null, string $method = null
4242
*/
4343
public function normalizeRequestHeaders(array $headers):array;
4444

45+
/**
46+
* @param mixed $data
47+
*
48+
* @return mixed
49+
*/
50+
public function rawurlencode($data);
51+
4552
/**
4653
* @param array $params
4754
* @param bool|null $urlencode

src/HTTPClientTrait.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,22 @@ protected function normalizeRequestHeaders(array $headers):array{
110110
return $this->http->normalizeRequestHeaders($headers);
111111
}
112112

113+
/**
114+
* @param mixed $data
115+
*
116+
* @return array
117+
*/
118+
protected function rawurlencode($data){
119+
return $this->http->rawurlencode($data);
120+
}
121+
113122
/**
114123
* @param mixed $params
115124
* @param bool|null $booleans_as_string
116125
*
117-
* @return array
126+
* @return mixed
118127
*/
119-
protected function checkQueryParams($params, bool $booleans_as_string = null):array{
128+
protected function checkQueryParams($params, bool $booleans_as_string = null){
120129

121130
if(is_array($params)){
122131
return $this->http->checkQueryParams($params, $booleans_as_string);

0 commit comments

Comments
 (0)