Skip to content

Commit 06c8a63

Browse files
authored
Test PHP 8.4 (#388)
1 parent 5e14067 commit 06c8a63

13 files changed

+30
-19
lines changed

.github/workflows/bc.yml_

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
os: >-
2121
['ubuntu-latest']
2222
php: >-
23-
['8.1']
23+
['8.4']

.github/workflows/build.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
matrix:
3333
php:
34-
- 8.3
34+
- 8.4
3535

3636
pgsql:
3737
- 9
@@ -48,6 +48,8 @@ jobs:
4848
pgsql: 16
4949
- php: 8.2
5050
pgsql: 16
51+
- php: 8.3
52+
pgsql: 16
5153

5254
services:
5355
postgres:

.github/workflows/composer-require-checker.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- 8.1
3333
- 8.2
3434
- 8.3
35+
- 8.4
3536

3637
steps:
3738
- name: Checkout.

.github/workflows/mutation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- ubuntu-latest
3131

3232
php:
33-
- 8.3
33+
- 8.4
3434

3535
services:
3636
postgres:

.github/workflows/rector.yml_

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
os: >-
1818
['ubuntu-latest']
1919
php: >-
20-
['8.3']
20+
['8.4']

.github/workflows/static.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ jobs:
3131
- ubuntu-latest
3232

3333
php:
34-
- '8.1'
35-
- '8.2'
36-
- '8.3'
34+
- 8.1
35+
- 8.2
36+
- 8.3
37+
- 8.4
3738

3839
steps:
3940
- name: Checkout.

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
- New #384: Add `IndexMethod` class (@Tigrov)
3232
- Bug #387: Explicitly mark nullable parameters (@vjik)
3333
- Enh #386: Refactor array, structured and JSON expression builders (@Tigrov)
34+
- Chg #388: Change supported PHP versions to `8.1 - 8.4` (@Tigrov)
35+
- Enh #388: Minor refactoring (@Tigrov)
3436

3537
## 1.3.0 March 21, 2024
3638

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ as stored procedures and server-side cursors.
2727

2828
| PHP | PostgreSQL Version | CI-Actions
2929
|---------------|---------------------|-----------
30-
| **8.1 - 8.3** | **9.0 - 16.0** |[![build](https://github.com/yiisoft/db-pgsql/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-pgsql/actions/workflows/build.yml) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-pgsql%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-pgsql/master) [![static analysis](https://github.com/yiisoft/db-pgsql/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-pgsql/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-pgsql/coverage.svg)](https://shepherd.dev/github/yiisoft/db-pgsql)
30+
| **8.1 - 8.4** | **9.0 - 16.0** |[![build](https://github.com/yiisoft/db-pgsql/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-pgsql/actions/workflows/build.yml) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-pgsql%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-pgsql/master) [![static analysis](https://github.com/yiisoft/db-pgsql/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-pgsql/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-pgsql/coverage.svg)](https://shepherd.dev/github/yiisoft/db-pgsql)
3131

3232
## Installation
3333

composer.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@
3131
}
3232
],
3333
"require": {
34-
"php": "^8.1",
34+
"php": "8.1 - 8.4",
3535
"ext-json": "*",
3636
"ext-pdo": "*",
3737
"ext-pdo_pgsql": "*",
3838
"yiisoft/db": "dev-master",
3939
"yiisoft/json": "^1.0"
4040
},
4141
"require-dev": {
42-
"maglnet/composer-require-checker": "^4.2",
43-
"phpunit/phpunit": "^10.0",
44-
"rector/rector": "^2.0.3",
45-
"roave/infection-static-analysis-plugin": "^1.16",
46-
"spatie/phpunit-watcher": "^1.23",
47-
"vimeo/psalm": "^5.25",
48-
"vlucas/phpdotenv": "^5.6",
42+
"maglnet/composer-require-checker": "^4.7.1",
43+
"phpunit/phpunit": "^10.5.45",
44+
"rector/rector": "^2.0.10",
45+
"roave/infection-static-analysis-plugin": "^1.35",
46+
"spatie/phpunit-watcher": "^1.24",
47+
"vimeo/psalm": "^5.26.1 || ^6.8.8",
48+
"vlucas/phpdotenv": "^5.6.1",
4949
"yiisoft/aliases": "^2.0",
50-
"yiisoft/cache-file": "^3.1",
51-
"yiisoft/var-dumper": "^1.5"
50+
"yiisoft/cache-file": "^3.2",
51+
"yiisoft/var-dumper": "^1.7"
5252
},
5353
"autoload": {
5454
"psr-4": {

psalm.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0"?>
22
<psalm
33
errorLevel="1"
4+
ensureOverrideAttribute="false"
45
findUnusedBaselineEntry="true"
56
findUnusedCode="false"
67
resolveFromConfigFile="true"

src/Column/ColumnDefinitionParser.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function parse(string $definition): array
2828
{
2929
preg_match(self::TYPE_PATTERN, $definition, $matches);
3030

31-
$type = strtolower($matches[3] ?? preg_replace('/\s*\(\d+\)/', '', $matches[1]));
31+
/** @var string $type */
32+
$type = $matches[3] ?? preg_replace('/\s*\(\d+\)/', '', $matches[1]);
33+
$type = strtolower($type);
3234
$info = ['type' => $type];
3335

3436
$typeDetails = $matches[4] ?? $matches[2] ?? '';

src/Column/ColumnFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ protected function getColumnClass(string $type, array $info = []): string
164164

165165
protected function normalizeNotNullDefaultValue(string $defaultValue, ColumnInterface $column): mixed
166166
{
167+
/** @var string $value */
167168
$value = preg_replace("/::[^:']+$/", '$1', $defaultValue);
168169

169170
if (str_starts_with($value, "B'") && $value[-1] === "'") {

src/DDLQueryBuilder.php

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function dropIndex(string $table, string $name): string
121121
{
122122
if (str_contains($table, '.') && !str_contains($name, '.')) {
123123
if (str_contains($table, '{{')) {
124+
/** @var string $table */
124125
$table = preg_replace('/{{(.*?)}}/', '\1', $table);
125126
[$schema] = explode('.', $table);
126127
if (!str_contains($schema, '%')) {

0 commit comments

Comments
 (0)