From 5e2856c3d00dcfebbd32626e154a5cbc6ac5c62b Mon Sep 17 00:00:00 2001 From: Darren Hodges Date: Fri, 8 Apr 2022 17:30:29 +0100 Subject: [PATCH] Bugfix: BootstrapEndpoint::logResponse(): Argument #1 ($logPath) must be of type string, null given --- src/Client.php | 8 ++++---- src/Endpoints/Assessment.php | 13 +++++++------ src/Endpoints/BootstrapEndpoint.php | 2 +- src/Endpoints/Schools.php | 2 +- src/ResultIterator.php | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Client.php b/src/Client.php index 9f9e924..04eecb5 100644 --- a/src/Client.php +++ b/src/Client.php @@ -36,7 +36,7 @@ class Client /** * @var string */ - const version = '3.1.0'; + const version = '3.1.1'; /** * @var string @@ -53,9 +53,9 @@ public function __construct($token, $logPath = '') } $this->token = $token; - $this->schools = new Schools($token); - $this->meta = new Meta($token); - $this->attendanceCodes = new AttendanceCodes($token); + $this->schools = new Schools($token, false, $logPath); + $this->meta = new Meta($token, false, $logPath); + $this->attendanceCodes = new AttendanceCodes($token, false, $logPath); $this->logPath = $logPath; } diff --git a/src/Endpoints/Assessment.php b/src/Endpoints/Assessment.php index c0aa2f3..5b8d141 100644 --- a/src/Endpoints/Assessment.php +++ b/src/Endpoints/Assessment.php @@ -41,18 +41,19 @@ class Assessment extends BootstrapEndpoint /** * Assessment constructor. */ - public function __construct($token, $id = false) + public function __construct($token, $id = false, $logPath = '') { $this->token = $token; + $this->logPath = $logPath; if ($id) { $this->uri = $this->uri . $id; } - $this->templates = new Templates($token, $this->uri); - $this->aspects = new Aspects($token, $this->uri); - $this->marksheets = new MarkSheets($token, $this->uri); - $this->results = new Results($token, $this->uri); - $this->resultsets = new ResultSets($token, $this->uri); + $this->templates = new Templates($token, $this->uri, $this->logPath); + $this->aspects = new Aspects($token, $this->uri, $this->logPath); + $this->marksheets = new MarkSheets($token, $this->uri, $this->logPath); + $this->results = new Results($token, $this->uri, $this->logPath); + $this->resultsets = new ResultSets($token, $this->uri, $this->logPath); } } \ No newline at end of file diff --git a/src/Endpoints/BootstrapEndpoint.php b/src/Endpoints/BootstrapEndpoint.php index 865fc5a..ca163ab 100644 --- a/src/Endpoints/BootstrapEndpoint.php +++ b/src/Endpoints/BootstrapEndpoint.php @@ -38,7 +38,7 @@ class BootstrapEndpoint /** * @var string */ - private $logPath; + private $logPath = ''; /** * BootstrapEndpoint constructor. diff --git a/src/Endpoints/Schools.php b/src/Endpoints/Schools.php index cc6de08..bc8be29 100644 --- a/src/Endpoints/Schools.php +++ b/src/Endpoints/Schools.php @@ -150,7 +150,7 @@ class Schools extends BootstrapEndpoint /** * @var string */ - private $logPath; + private $logPath = ''; /** * Schools constructor. diff --git a/src/ResultIterator.php b/src/ResultIterator.php index bd7c198..56cf4ec 100644 --- a/src/ResultIterator.php +++ b/src/ResultIterator.php @@ -22,7 +22,7 @@ class ResultIterator extends BootstrapEndpoint implements \Iterator /** * @var string */ - private $logPath; + private $logPath = ''; public function __construct($givenArray, $token, $logPath = '') {