ReviewOS

also looking at this

meemalabs/meema-client-php

initialize progress

#1
Merged glennmichael123 wants to merge initial-progress into main
17 files +581 -48

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

src/Client.phpmodified+15-2
Changes to src/Client.php
@@ -2,6 +2,7 @@
22
33namespace Meema\MeemaApi;
44
5use Dotenv\Dotenv;
56use GuzzleHttp\Client as GuzzleClient;
67use Meema\MeemaApi\Models\Folder;
78
@@ -29,19 +30,31 @@ class Client
2930 */
3031 public function __construct($accessKey)
3132 {
33 $this->initializeEnv();
34
3235 $this->accessKey = $accessKey;
3336 $this->client = new GuzzleClient([
34 'base_uri' => 'http://meema-api.test/api/',
37 'base_uri' => $_ENV['BASE_URL'],
3538 ]);
3639 }
3740
41 /**
42 * Initialize env variables.
43 *
44 * @return void
45 */
46 public function initializeEnv(): void
47 {
48 $dotenv = Dotenv::createImmutable(dirname(__DIR__));
49 $dotenv->load();
50 }
51
3852 /**
3953 * Handle the API request.
4054 *
4155 * @param string $method
4256 * @param string $path
4357 *
44 * @return array
4558 */
4659 public function request($method, $path, $data = null)
4760 {