Skip to content

Commit 5a7e940

Browse files
committed
fix: php 8.4 compatibility (resolves #102)
1 parent 2e47e65 commit 5a7e940

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

.github/workflows/comaptibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php: [8.2, 8.3]
14+
php: [8.2, 8.3, 8.4]
1515
laravel: [11.x-dev]
1616
testbench: [9.*]
1717

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup PHP
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: '8.1'
15+
php-version: '8.4'
1616
extensions: fileinfo, pdo
1717
coverage: none
1818

.github/workflows/phpunit.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php: [8.0, 8.1, 8.2, 8.3]
11+
php: [8.0, 8.1, 8.2, 8.3, 8.4]
1212
laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*]
1313
stability: [prefer-lowest, prefer-stable]
1414
include:
@@ -57,6 +57,16 @@ jobs:
5757
- php: 8.3
5858
laravel: 9.*
5959
stability: prefer-lowest
60+
- php: 8.4
61+
laravel: 6.*
62+
- php: 8.4
63+
laravel: 7.*
64+
- php: 8.4
65+
laravel: 8.*
66+
stability: prefer-lowest
67+
- php: 8.4
68+
laravel: 9.*
69+
stability: prefer-lowest
6070
- laravel: 11.*
6171
php: 8.0
6272
- laravel: 11.*

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'@Symfony' => true,
1818
'binary_operator_spaces' => ['operators' => ['|' => null]], // https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5495
1919
'global_namespace_import' => false,
20-
'nullable_type_declaration_for_default_null_value' => false,
20+
'nullable_type_declaration_for_default_null_value' => true,
2121
'ordered_class_elements' => [
2222
'order' => [
2323
'use_trait',

src/PostgresConnectionBackport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait PostgresConnectionBackport
1515
/**
1616
* All of the callbacks that should be invoked before a query is executed.
1717
*
18-
* @var \Closure[]
18+
* @var Closure[]
1919
*/
2020
protected $beforeExecutingCallbacks = [];
2121

src/Query/BuilderReturning.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait BuilderReturning
1616
/**
1717
* Delete records from the database.
1818
*
19-
* @return \Illuminate\Support\Collection<int, object>
19+
* @return Collection<int, object>
2020
*/
2121
public function deleteReturning(mixed $id = null, array $returning = ['*']): Collection
2222
{
@@ -44,7 +44,7 @@ public function deleteReturning(mixed $id = null, array $returning = ['*']): Col
4444
/**
4545
* Insert new records into the database while ignoring errors.
4646
*
47-
* @return \Illuminate\Support\Collection<int, object>
47+
* @return Collection<int, object>
4848
*/
4949
public function insertOrIgnoreReturning(array $values, array $returning = ['*']): Collection
5050
{
@@ -80,7 +80,7 @@ public function insertOrIgnoreReturning(array $values, array $returning = ['*'])
8080
/**
8181
* Insert new records into the database.
8282
*
83-
* @return \Illuminate\Support\Collection<int, object>
83+
* @return Collection<int, object>
8484
*/
8585
public function insertReturning(array $values, array $returning = ['*']): Collection
8686
{
@@ -128,7 +128,7 @@ public function insertReturning(array $values, array $returning = ['*']): Collec
128128
*
129129
* @param \Closure|\Illuminate\Contracts\Database\Query\Builder|string $query
130130
*
131-
* @return \Illuminate\Support\Collection<int, object>
131+
* @return Collection<int, object>
132132
*/
133133
public function insertUsingReturning(array $columns, $query, array $returning = ['*']): Collection
134134
{
@@ -153,7 +153,7 @@ public function insertUsingReturning(array $columns, $query, array $returning =
153153
/**
154154
* Update records in a PostgreSQL database using the update from syntax.
155155
*
156-
* @return \Illuminate\Support\Collection<int, object>
156+
* @return Collection<int, object>
157157
*/
158158
public function updateFromReturning(array $values, array $returning = ['*']): Collection
159159
{
@@ -176,7 +176,7 @@ public function updateFromReturning(array $values, array $returning = ['*']): Co
176176
/**
177177
* Insert or update a record matching the attributes, and fill it with values.
178178
*
179-
* @return \Illuminate\Support\Collection<int, object>
179+
* @return Collection<int, object>
180180
*/
181181
public function updateOrInsertReturning(array $attributes, array $values = [], array $returning = ['*']): Collection
182182
{
@@ -194,7 +194,7 @@ public function updateOrInsertReturning(array $attributes, array $values = [], a
194194
/**
195195
* Update records in the database.
196196
*
197-
* @return \Illuminate\Support\Collection<int, object>
197+
* @return Collection<int, object>
198198
*/
199199
public function updateReturning(array $values, array $returning = ['*']): Collection
200200
{
@@ -217,7 +217,7 @@ public function updateReturning(array $values, array $returning = ['*']): Collec
217217
/**
218218
* Insert new records or update the existing ones.
219219
*
220-
* @return \Illuminate\Support\Collection<int, object>
220+
* @return Collection<int, object>
221221
*/
222222
public function upsertReturning(array $values, array|string $uniqueBy, ?array $update = null, array $returning = ['*']): Collection
223223
{

src/Schema/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getConnection(): PostgresEnhancedConnection
3131
*
3232
* @param string $table
3333
*/
34-
protected function createBlueprint($table, Closure $callback = null): Blueprint
34+
protected function createBlueprint($table, ?Closure $callback = null): Blueprint
3535
{
3636
return new Blueprint($table, $callback);
3737
}

src/Schema/BuilderDomain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function changeDomainConstraint(string $name, Closure|string|null $check)
3131
/**
3232
* Create a new domain in the schema.
3333
*/
34-
public function createDomain(string $name, string $type, Closure|string $check = null): void
34+
public function createDomain(string $name, string $type, Closure|string|null $check = null): void
3535
{
3636
if ($check instanceof Closure) {
3737
$query = tap($this->getConnection()->query(), $check);

0 commit comments

Comments
 (0)