diff --git a/.github/workflows/create-coverage-report.yml b/.github/workflows/create-coverage-report.yml index 056ce07..dde1094 100644 --- a/.github/workflows/create-coverage-report.yml +++ b/.github/workflows/create-coverage-report.yml @@ -13,7 +13,7 @@ on: - "**" pull_request: branches: - - "main" + - "master" paths: - "src/**.php" - "tests/**.php" diff --git a/CHANGELOG.rst b/CHANGELOG.rst index db6fa98..9e457cf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,36 @@ Versioning `__. `[Unreleased] `_ ----------------------------------------------------------- +Added +~~~~~ + +- n/a + +Changed +~~~~~~~ + +- n/a + +Deprecated +~~~~~~~~~~ + +- n/a + +Removed +~~~~~~~ + +- n/a + +Fixed +~~~~~ + +- Initialize properties with default values, to avoid errors when calling methods before setting properties + +Security +~~~~~~~~ + +- n/a + `[0.0.1] `_ - 2023-07-24 ------------------------------------------------------------------------ diff --git a/composer.json b/composer.json index 4f3eb62..e9f2c42 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "PostgREST client for PHP. This library provides a synchronous and asynchronous interface to PostgREST.", "type": "library", "license": "BSD-3-Clause", - "version": "0.0.1", "authors": [ { "name": "Kirill Fuks", diff --git a/src/RequestBuilder/PostgrestRequestBuilder.php b/src/RequestBuilder/PostgrestRequestBuilder.php index d2c180a..51f8fe4 100644 --- a/src/RequestBuilder/PostgrestRequestBuilder.php +++ b/src/RequestBuilder/PostgrestRequestBuilder.php @@ -53,6 +53,7 @@ final public function __construct( 'Content-Profile' => $this->schemaName, ]; $this->filters = []; + $this->method = ''; $this->body = null; $this->helper = new Helper(); } diff --git a/src/Response/Exceptions/PostgrestErrorException.php b/src/Response/Exceptions/PostgrestErrorException.php index 62ae551..ee62771 100644 --- a/src/Response/Exceptions/PostgrestErrorException.php +++ b/src/Response/Exceptions/PostgrestErrorException.php @@ -14,15 +14,15 @@ */ class PostgrestErrorException extends Exception { - private ?int $statusCode; + private ?int $statusCode = null; - private ?string $reasonPhrase; + private ?string $reasonPhrase = null; - private ?string $responseBody; + private ?string $responseBody = null; - private ?string $postgrestErrorCode; + private ?string $postgrestErrorCode = null; - private ?string $postgrestErrorMessage; + private ?string $postgrestErrorMessage = null; /** * Create a new PostgrestErrorException. diff --git a/src/Response/PostgrestResponse.php b/src/Response/PostgrestResponse.php index b263987..30cda52 100644 --- a/src/Response/PostgrestResponse.php +++ b/src/Response/PostgrestResponse.php @@ -28,7 +28,7 @@ class PostgrestResponse /** * @var array */ - private array $location; + private array $location = []; private int $contentRangeStart = 0;