From b5ce2649f48f9e094480f34f2a30fa2d242eda4b Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Wed, 20 Mar 2024 13:10:10 +0100 Subject: [PATCH] fix: property access before initialization bug --- src/Reflect/Client.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Reflect/Client.php b/src/Reflect/Client.php index baeee7d..9759f00 100644 --- a/src/Reflect/Client.php +++ b/src/Reflect/Client.php @@ -21,7 +21,7 @@ $this->key = $key; // Append tailing "/" if absent - $this->base_url = substr($this->base_url, -1) === "/" ? $this->base_url : $this->base_url . "/"; + $this->base_url = substr($base_url, -1) === "/" ? $base_url : $base_url . "/"; // Flag which enables or disables SSL peer validation (for self-signed certificates) $this->https_verify_peer = $verify_peer; } @@ -84,9 +84,9 @@ // Create a new call to an endpoint public function call(string $endpoint): self { // Remove leading "/" if present, as it's already present in $this->base_url - $this->endpoint = substr($this->endpoint, 0, 1) !== "/" - ? $this->endpoint - : substr($this->endpoint, 1, strlen($this->endpoint) - 1); + $this->endpoint = substr($endpoint, 0, 1) !== "/" + ? $endpoint + : substr($endpoint, 1, strlen($endpoint) - 1); // Reset search parameters $this->params();