Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "**"
pull_request:
branches:
- "main"
- "master"
paths:
- "src/**.php"
- "tests/**.php"
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@ Versioning <https://semver.org/spec/v2.0.0.html>`__.
`[Unreleased] <https://campoint.github.io/postgrest-php/latest>`_
-----------------------------------------------------------

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] <https://campoint.github.io/postgrest-php/0.0.1>`_ - 2023-07-24
------------------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/RequestBuilder/PostgrestRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ final public function __construct(
'Content-Profile' => $this->schemaName,
];
$this->filters = [];
$this->method = '';
$this->body = null;
$this->helper = new Helper();
}
Expand Down
10 changes: 5 additions & 5 deletions src/Response/Exceptions/PostgrestErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Response/PostgrestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PostgrestResponse
/**
* @var array<string, string|int|float>
*/
private array $location;
private array $location = [];

private int $contentRangeStart = 0;

Expand Down