Skip to content

Commit

Permalink
fix: php 8.4 compatibility (resolves #102)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetry committed Dec 5, 2024
1 parent 2e47e65 commit 5a7e940
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/comaptibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.2, 8.3]
php: [8.2, 8.3, 8.4]
laravel: [11.x-dev]
testbench: [9.*]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
extensions: fileinfo, pdo
coverage: none

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3]
php: [8.0, 8.1, 8.2, 8.3, 8.4]
laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*]
stability: [prefer-lowest, prefer-stable]
include:
Expand Down Expand Up @@ -57,6 +57,16 @@ jobs:
- php: 8.3
laravel: 9.*
stability: prefer-lowest
- php: 8.4
laravel: 6.*
- php: 8.4
laravel: 7.*
- php: 8.4
laravel: 8.*
stability: prefer-lowest
- php: 8.4
laravel: 9.*
stability: prefer-lowest
- laravel: 11.*
php: 8.0
- laravel: 11.*
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'@Symfony' => true,
'binary_operator_spaces' => ['operators' => ['|' => null]], // https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5495
'global_namespace_import' => false,
'nullable_type_declaration_for_default_null_value' => false,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
Expand Down
2 changes: 1 addition & 1 deletion src/PostgresConnectionBackport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait PostgresConnectionBackport
/**
* All of the callbacks that should be invoked before a query is executed.
*
* @var \Closure[]
* @var Closure[]
*/
protected $beforeExecutingCallbacks = [];

Expand Down
16 changes: 8 additions & 8 deletions src/Query/BuilderReturning.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait BuilderReturning
/**
* Delete records from the database.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function deleteReturning(mixed $id = null, array $returning = ['*']): Collection
{
Expand Down Expand Up @@ -44,7 +44,7 @@ public function deleteReturning(mixed $id = null, array $returning = ['*']): Col
/**
* Insert new records into the database while ignoring errors.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function insertOrIgnoreReturning(array $values, array $returning = ['*']): Collection
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public function insertOrIgnoreReturning(array $values, array $returning = ['*'])
/**
* Insert new records into the database.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function insertReturning(array $values, array $returning = ['*']): Collection
{
Expand Down Expand Up @@ -128,7 +128,7 @@ public function insertReturning(array $values, array $returning = ['*']): Collec
*
* @param \Closure|\Illuminate\Contracts\Database\Query\Builder|string $query
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function insertUsingReturning(array $columns, $query, array $returning = ['*']): Collection
{
Expand All @@ -153,7 +153,7 @@ public function insertUsingReturning(array $columns, $query, array $returning =
/**
* Update records in a PostgreSQL database using the update from syntax.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function updateFromReturning(array $values, array $returning = ['*']): Collection
{
Expand All @@ -176,7 +176,7 @@ public function updateFromReturning(array $values, array $returning = ['*']): Co
/**
* Insert or update a record matching the attributes, and fill it with values.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function updateOrInsertReturning(array $attributes, array $values = [], array $returning = ['*']): Collection
{
Expand All @@ -194,7 +194,7 @@ public function updateOrInsertReturning(array $attributes, array $values = [], a
/**
* Update records in the database.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function updateReturning(array $values, array $returning = ['*']): Collection
{
Expand All @@ -217,7 +217,7 @@ public function updateReturning(array $values, array $returning = ['*']): Collec
/**
* Insert new records or update the existing ones.
*
* @return \Illuminate\Support\Collection<int, object>
* @return Collection<int, object>
*/
public function upsertReturning(array $values, array|string $uniqueBy, ?array $update = null, array $returning = ['*']): Collection
{
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getConnection(): PostgresEnhancedConnection
*
* @param string $table
*/
protected function createBlueprint($table, Closure $callback = null): Blueprint
protected function createBlueprint($table, ?Closure $callback = null): Blueprint
{
return new Blueprint($table, $callback);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/BuilderDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function changeDomainConstraint(string $name, Closure|string|null $check)
/**
* Create a new domain in the schema.
*/
public function createDomain(string $name, string $type, Closure|string $check = null): void
public function createDomain(string $name, string $type, Closure|string|null $check = null): void
{
if ($check instanceof Closure) {
$query = tap($this->getConnection()->query(), $check);
Expand Down

0 comments on commit 5a7e940

Please sign in to comment.