diff --git a/composer.json b/composer.json index 66a1127..d6322fc 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,11 @@ } ], "require": { - "guzzlehttp/guzzle": "^6.0.0" + "php": "^7.2.5 || ^8.0", + "guzzlehttp/guzzle": "^7.2.0" }, "require-dev": { - "phpunit/phpunit": "4.0.*" + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index d7e1f24..1088db4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> ./tests/ diff --git a/readme.md b/readme.md index fdac15b..0712503 100644 --- a/readme.md +++ b/readme.md @@ -4,14 +4,14 @@ Documentation https://wonde.com/docs/api/1.0/ ## Installation -Requires PHP 5.6. +Requires PHP 7.2.5+ (including PHP 8.0) Using Composer: ```json { "require": { - "wondeltd/php-client": "1.*" + "wondeltd/php-client": "3.*" } } ``` diff --git a/src/Client.php b/src/Client.php index 2bdc531..1cf16b8 100644 --- a/src/Client.php +++ b/src/Client.php @@ -23,6 +23,11 @@ class Client */ public $meta; + /** + * @var Schools + */ + public $schools; + /** * @var string */ @@ -31,7 +36,7 @@ class Client /** * @var string */ - const version = '2.1.2'; + const version = '3.0.0'; /** * Client constructor. diff --git a/src/Endpoints/BootstrapEndpoint.php b/src/Endpoints/BootstrapEndpoint.php index ab04b5e..7b97694 100644 --- a/src/Endpoints/BootstrapEndpoint.php +++ b/src/Endpoints/BootstrapEndpoint.php @@ -54,23 +54,12 @@ public function __construct($token, $uri = false) */ private function client() { - if ((float) Client::VERSION >= 6) { - return new Client([ - 'headers' => [ - 'Authorization' => 'Basic ' . base64_encode($this->token . ':'), - 'User-Agent' => 'wonde-php-client-' . \Wonde\Client::version - ] - ]); - } else { - return new Client([ - 'defaults' => [ - 'headers' => [ - 'Authorization' => 'Basic ' . base64_encode($this->token . ':'), - 'User-Agent' => 'wonde-php-client-' . \Wonde\Client::version - ] - ] - ]); - } + return new Client([ + 'headers' => [ + 'Authorization' => 'Basic ' . base64_encode($this->token . ':'), + 'User-Agent' => 'wonde-php-client-' . \Wonde\Client::version + ] + ]); } /** diff --git a/tests/AssessmentTest.php b/tests/AssessmentTest.php index f3bbeee..a1d1f58 100644 --- a/tests/AssessmentTest.php +++ b/tests/AssessmentTest.php @@ -1,13 +1,14 @@ token = file_get_contents(__DIR__ . '/../.token'); diff --git a/tests/MiscEndPointsTest.php b/tests/MiscEndPointsTest.php index 1afc005..3d5509a 100644 --- a/tests/MiscEndPointsTest.php +++ b/tests/MiscEndPointsTest.php @@ -1,6 +1,7 @@ token = file_get_contents(__DIR__ . '/../.token');