ReviewOS

also looking at this

meemalabs/meema-client-php

Collection response

#52
Merged glennmichael123 wants to merge collection-response into main
11 files +3638 -3582
src/Client.phpmodified+19-2
Changes to src/Client.php
@@ -21,18 +21,25 @@ class Client
2121 */
2222 protected $accessKey;
2323
24 /**
25 * @var array
26 */
27 protected $config;
28
2429 /**
2530 * Construct Meema client.
2631 *
2732 * @param string $accessKey
2833 */
29 public function __construct($accessKey, $baseUrl = null)
34 public function __construct($accessKey, $config = [])
3035 {
3136 $this->initializeEnv();
3237
3338 $this->accessKey = $accessKey;
3439
35 $url = $baseUrl ?? env('BASE_URL');
40 $this->config = $config;
41
42 $url = $config['base_url'] ?? env('BASE_URL');
3643
3744 $this->client = new GuzzleClient([
3845 'base_uri' => $url ?? 'https://api.mee.ma',
@@ -140,4 +147,14 @@ class Client
140147 {
141148 return new Favorite($this);
142149 }
150
151 /**
152 * Get the client config.
153 *
154 * @return array
155 */
156 public function getConfig()
157 {
158 return $this->config;
159 }
143160}