11<?php
22/**
3- * PHP-Firebase
3+ * PHP-Firebase.
44 *
55 * @link https://github.com/adrorocker/php-firebase
6+ *
67 * @copyright Copyright (c) 2018 Adro Rocker
78 * @author Adro Rocker <mes@adro.rocks>
89 */
10+
911namespace PhpFirebase \Clients ;
1012
11- use InvalidArgumentException ;
12- use PhpFirebase \Interfaces \ClientInterface ;
1313use GuzzleHttp \Client as HttpClient ;
14- use GuzzleHttp \Exception \ClientException ;
1514use GuzzleHttp \Psr7 \Request ;
1615use GuzzleHttp \Psr7 \Response ;
17- use GuzzleHttp \ Psr7 \ Uri ;
16+ use PhpFirebase \ Interfaces \ ClientInterface ;
1817use function GuzzleHttp \Psr7 \stream_for ;
1918
2019/**
2120 * Guzzle Client.
2221 *
23- * @package PhpFirebase
24- * @subpackage Clients
2522 * @since 0.1.0
2623 */
2724class GuzzleClient implements ClientInterface
2825{
2926 /**
30- * Guzzle client
27+ * Guzzle client.
3128 *
3229 * @var \GuzzleHttp\Client
3330 */
3431 protected $ guzzle ;
3532
3633 /**
37- * Set the the guzzle client
34+ * Set the the guzzle client.
3835 *
39- * @param array $options The options to set the defaul
40- * @param Object |null $client Client to make the requests
36+ * @param array $options The options to set the defaul
37+ * @param object |null $client Client to make the requests
4138 */
4239 public function __construct (array $ options = [], $ client = null )
4340 {
4441 if (!$ client ) {
4542 $ client = new HttpClient ($ options );
4643 }
47-
44+
4845 $ this ->guzzle = $ client ;
4946 }
5047
5148 /**
52- * Create a new GET reuest
49+ * Create a new GET reuest.
5350 *
5451 * @param string $endpoint The sub endpoint
55- * @param array $headers Request headers
52+ * @param array $headers Request headers
5653 *
5754 * @return array
5855 */
@@ -66,11 +63,11 @@ public function get($endpoint, $headers = [])
6663 }
6764
6865 /**
69- * Create a new POST reuest
66+ * Create a new POST reuest.
7067 *
71- * @param string $endpoint The sub endpoint
72- * @param string|array $data The data to be submited
73- * @param array $headers Request headers
68+ * @param string $endpoint The sub endpoint
69+ * @param string|array $data The data to be submited
70+ * @param array $headers Request headers
7471 *
7572 * @return array
7673 */
@@ -84,11 +81,11 @@ public function post($endpoint, $data, $headers = [])
8481 }
8582
8683 /**
87- * Create a new PUT reuest
84+ * Create a new PUT reuest.
8885 *
89- * @param string $endpoint The sub endpoint
90- * @param string|array $data The data to be submited
91- * @param array $headers Request headers
86+ * @param string $endpoint The sub endpoint
87+ * @param string|array $data The data to be submited
88+ * @param array $headers Request headers
9289 *
9390 * @return array
9491 */
@@ -102,11 +99,11 @@ public function put($endpoint, $data, $headers = [])
10299 }
103100
104101 /**
105- * Create a new PATCH reuest
102+ * Create a new PATCH reuest.
106103 *
107- * @param string $endpoint The sub endpoint
108- * @param string|array $data The data to be submited
109- * @param array $headers Request headers
104+ * @param string $endpoint The sub endpoint
105+ * @param string|array $data The data to be submited
106+ * @param array $headers Request headers
110107 *
111108 * @return array
112109 */
@@ -120,10 +117,10 @@ public function patch($endpoint, $data, $headers = [])
120117 }
121118
122119 /**
123- * Create a new DELETE reuest
120+ * Create a new DELETE reuest.
124121 *
125122 * @param string $endpoint The sub endpoint
126- * @param array $headers Request headers
123+ * @param array $headers Request headers
127124 *
128125 * @return array
129126 */
@@ -136,10 +133,8 @@ public function delete($endpoint, $headers = [])
136133 return $ this ->handle ($ response );
137134 }
138135
139-
140-
141136 /**
142- * Handle the response
137+ * Handle the response.
143138 *
144139 * @param \GuzzleHttp\Psr7\Response $response The response
145140 *
0 commit comments