Skip to content

Commit 0761fd3

Browse files
committed
no issue - PHP 8.4 support
1 parent b3ef670 commit 0761fd3

15 files changed

+51
-28
lines changed

Diff for: .github/workflows/continuous-integration.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- "8.1"
3535
- "8.2"
3636
- "8.3"
37+
- "8.4"
3738
postgres-version:
3839
- "16"
3940
extension:
@@ -68,7 +69,7 @@ jobs:
6869
ini-values: "zend.assertions=1"
6970

7071
- name: "Install dependencies with Composer"
71-
uses: "ramsey/composer-install@v2"
72+
uses: "ramsey/composer-install@v3"
7273
with:
7374
dependency-versions: "${{ matrix.dependencies }}"
7475
composer-options: "--ignore-platform-req=php+"
@@ -132,7 +133,7 @@ jobs:
132133
ini-values: "zend.assertions=1"
133134

134135
- name: "Install dependencies with Composer"
135-
uses: "ramsey/composer-install@v2"
136+
uses: "ramsey/composer-install@v3"
136137
with:
137138
composer-options: "--ignore-platform-req=php+"
138139

@@ -195,7 +196,7 @@ jobs:
195196
extensions: "${{ matrix.extension }}"
196197

197198
- name: "Install dependencies with Composer"
198-
uses: "ramsey/composer-install@v2"
199+
uses: "ramsey/composer-install@v3"
199200
with:
200201
composer-options: "--ignore-platform-req=php+"
201202

@@ -256,7 +257,7 @@ jobs:
256257
extensions: "${{ matrix.extension }}"
257258

258259
- name: "Install dependencies with Composer"
259-
uses: "ramsey/composer-install@v2"
260+
uses: "ramsey/composer-install@v3"
260261
with:
261262
composer-options: "--ignore-platform-req=php+"
262263

@@ -314,7 +315,7 @@ jobs:
314315
extensions: "${{ matrix.extension }}-5.10.0"
315316

316317
- name: "Install dependencies with Composer"
317-
uses: "ramsey/composer-install@v2"
318+
uses: "ramsey/composer-install@v3"
318319
with:
319320
composer-options: "--ignore-platform-req=php+"
320321

@@ -363,7 +364,7 @@ jobs:
363364
ini-values: "zend.assertions=1"
364365

365366
- name: "Install dependencies with Composer"
366-
uses: "ramsey/composer-install@v2"
367+
uses: "ramsey/composer-install@v3"
367368
with:
368369
composer-options: "--ignore-platform-req=php+"
369370

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Next
4+
5+
* [feature] ⭐️ PHP 8.4 support.
6+
37
## 1.6.2
48

59
* [feature] ⭐️ Allow `Converter::fromSql()` `$type` parameter to be a user-given callback.

Diff for: dev.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GREEN='\033[0;32m'
55
NC='\033[0m' # No Color
66

77
# PHP version.
8-
PHPVER="8-1"
8+
PHPVER="8-4"
99
# Extra parameters passed to all docker command lines.
1010
EXTRA_DOCKER_ENV=""
1111

@@ -21,11 +21,17 @@ while getopts ":xp:l" opt; do
2121
p)
2222
p=${OPTARG}
2323
case "${OPTARG}" in
24+
"8.1")
25+
PHPVER="8-1"
26+
;;
2427
"8.3")
2528
PHPVER="8-3"
2629
;;
30+
"8.4")
31+
PHPVER="8-4"
32+
;;
2733
*)
28-
PHPVER="8-1"
34+
PHPVER="8-4"
2935
;;
3036
esac
3137
;;

Diff for: docker-compose.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ services:
2323
XDEBUG_MODE: "${XDEBUG_MODE:-debug}"
2424
extra_hosts:
2525
- "host.docker.internal:host-gateway"
26+
phpunit-8-4:
27+
build: ./docker/php-8.4
28+
networks:
29+
- query-builder-test
30+
volumes:
31+
- ./:/var/www
32+
environment:
33+
PHP_IDE_CONFIG: ${PHP_IDE_CONFIG:-serverName=docker}
34+
XDEBUG_CONFIG: "client_host=host.docker.internal client_port=9000 log=/tmp/xdebug/xdebug.log output_dir=/tmp/xdebug start_with_request=trigger"
35+
XDEBUG_MODE: "${XDEBUG_MODE:-debug}"
36+
extra_hosts:
37+
- "host.docker.internal:host-gateway"
2638
mysql57:
2739
image: mysql:5.7
2840
restart: 'no'

Diff for: src/Bridge/AbstractBridge.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function getDefaultSchema(): string
251251
abstract protected function doExecuteQuery(string $expression, array $arguments = []): Result;
252252

253253
#[\Override]
254-
public function executeQuery(string|Expression $expression = null, mixed $arguments = null): Result
254+
public function executeQuery(null|string|Expression $expression = null, mixed $arguments = null): Result
255255
{
256256
if (\is_string($expression)) {
257257
$expression = new Raw($expression, $arguments);
@@ -277,7 +277,7 @@ public function executeQuery(string|Expression $expression = null, mixed $argume
277277
abstract protected function doExecuteStatement(string $expression, array $arguments = []): ?int;
278278

279279
#[\Override]
280-
public function executeStatement(string|Expression $expression = null, mixed $arguments = null): ?int
280+
public function executeStatement(null|string|Expression $expression = null, mixed $arguments = null): ?int
281281
{
282282
if (\is_string($expression)) {
283283
$expression = new Raw($expression, $arguments);

Diff for: src/DatabaseSession.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public function vendorVersionIs(string $version, string $operator = '>='): bool;
7474
/**
7575
* Execute query and return result.
7676
*/
77-
public function executeQuery(string|Expression $expression = null, mixed $arguments = null): Result;
77+
public function executeQuery(null|string|Expression $expression = null, mixed $arguments = null): Result;
7878

7979
/**
8080
* Execute query and return affected row count if possible.
8181
*
8282
* @return null|int
8383
* Affected row count if applyable and driver supports it.
8484
*/
85-
public function executeStatement(string|Expression $expression = null, mixed $arguments = null): ?int;
85+
public function executeStatement(null|string|Expression $expression = null, mixed $arguments = null): ?int;
8686

8787
/**
8888
* Creates a new transaction.

Diff for: src/DefaultQueryBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function delete(string|Expression $table, ?string $alias = null): Delete
6868
}
6969

7070
#[\Override]
71-
public function raw(string $expression = null, mixed $arguments = null, bool $returns = false): RawQuery
71+
public function raw(null|string $expression = null, mixed $arguments = null, bool $returns = false): RawQuery
7272
{
7373
$ret = new RawQuery($expression, $arguments, $returns);
7474
$this->prepareQuery($ret);

Diff for: src/Platform/Transaction/AbstractTransaction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function deferred($constraint = null): static
176176
}
177177

178178
#[\Override]
179-
public function savepoint(string $name = null): TransactionSavepoint
179+
public function savepoint(null|string $name = null): TransactionSavepoint
180180
{
181181
if (!$this->started) {
182182
throw new TransactionError(\sprintf("can not commit a non-running transaction"));

Diff for: src/Query/Partial/FromClauseTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ final public function leftJoin(string|Expression $table, $condition = null, ?str
109109
/**
110110
* Add inner statement and return the associated Where.
111111
*/
112-
final public function innerJoinWhere(string|Expression $table, string $alias = null): Where
112+
final public function innerJoinWhere(string|Expression $table, null|string $alias = null): Where
113113
{
114114
return $this->joinWhere($table, $alias, Query::JOIN_INNER);
115115
}
116116

117117
/**
118118
* Add left outer join statement and return the associated Where.
119119
*/
120-
final public function leftJoinWhere(string|Expression $table, string $alias = null): Where
120+
final public function leftJoinWhere(string|Expression $table, null|string $alias = null): Where
121121
{
122122
return $this->joinWhere($table, $alias, Query::JOIN_LEFT_OUTER);
123123
}

Diff for: src/QueryBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function delete(string|Expression $table, ?string $alias = null): Delete;
4444
/**
4545
* Create raw SQL query.
4646
*/
47-
public function raw(string $expression = null, mixed $arguments = null, bool $returns = false): RawQuery;
47+
public function raw(null|string $expression = null, mixed $arguments = null, bool $returns = false): RawQuery;
4848

4949
/**
5050
* Get the expression factory.

Diff for: src/Result/IterableResult.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class IterableResult extends AbstractResult
1515
public function __construct(
1616
iterable $data,
1717
private ?int $rowCount = null,
18-
callable $freeCallback = null,
18+
null|callable $freeCallback = null,
1919
) {
2020
parent::__construct(false);
2121

Diff for: src/Transaction/Transaction.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ public function start(): static;
3434
/**
3535
* Set as immediate all or a set of constraints.
3636
*
37-
* @param string|string[] $constraint
37+
* @param null|string|string[] $constraint
3838
* If set to null, all constraints are set immediate
3939
* If a string or a string array, only the given constraint
4040
* names are set as immediate.
4141
*/
42-
public function immediate(string|array $constraint = null): static;
42+
public function immediate(null|string|array $constraint = null): static;
4343

4444
/**
4545
* Defer all or a set of constraints.
4646
*
47-
* @param string|string[] $constraint
47+
* @param null|string|string[] $constraint
4848
* If set to null, all constraints are set immediate
4949
* If a string or a string array, only the given constraint
5050
* names are set as immediate.
5151
*/
52-
public function deferred(string|array $constraint = null): static;
52+
public function deferred(null|string|array $constraint = null): static;
5353

5454
/**
5555
* Creates a savepoint and return its name.
5656
*
57-
* @param string $name
57+
* @param null|string $name
5858
* Optional user given savepoint name, if none provided a name will be
5959
* automatically computed using a serial.
6060
*
@@ -64,7 +64,7 @@ public function deferred(string|array $constraint = null): static;
6464
* @return TransactionSavepoint
6565
* The nested transaction.
6666
*/
67-
public function savepoint(string $name = null): TransactionSavepoint;
67+
public function savepoint(null|string $name = null): TransactionSavepoint;
6868

6969
/**
7070
* Is transaction nested (ie. is a savepoint).

Diff for: src/Type/Type.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function bool(): self
5353
/**
5454
* Padded fixed-with character string.
5555
*/
56-
public static function char(int $length = null): self
56+
public static function char(null|int $length = null): self
5757
{
5858
return new self(internal: InternalType::CHAR, length: $length);
5959
}
@@ -79,7 +79,7 @@ public static function dateInterval(): self
7979
/**
8080
* Decimal/numeric arbitrary precision numeric value.
8181
*/
82-
public static function decimal(?int $precision = null, int $scale = null): self
82+
public static function decimal(null|int $precision = null, null|int $scale = null): self
8383
{
8484
return new self(internal: InternalType::DECIMAL, precision: $precision, scale: $scale);
8585
}

Diff for: src/Where.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function addNotExpression(mixed $expression): void
148148
/**
149149
* Add a single raw SQL expression.
150150
*/
151-
public function withRaw(string $expression, mixed $arguments = null): static
151+
public function withRaw(null|string $expression, mixed $arguments = null): static
152152
{
153153
$this->addExpression(new Raw($expression, $arguments));
154154

Diff for: src/Writer/Writer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ protected function doFormatJoin(
616616
array $join,
617617
bool $transformFirstJoinAsFrom = false,
618618
?string $fromPrefix = null,
619-
Query $query = null
619+
null|Query $query = null
620620
): string {
621621
if (!$join) {
622622
return '';

0 commit comments

Comments
 (0)