Skip to content

Commit 507e868

Browse files
authored
Test PHP 8.4 (#306)
1 parent bdd1db4 commit 507e868

16 files changed

+41
-27
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
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
php:
38-
- 8.3
38+
- 8.4
3939

4040
oracle:
4141
- 18
@@ -46,6 +46,8 @@ jobs:
4646
oracle: 21
4747
- php: 8.2
4848
oracle: 21
49+
- php: 8.3
50+
oracle: 21
4951

5052
services:
5153
oci:

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

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- 8.1
3737
- 8.2
3838
- 8.3
39+
- 8.4
3940

4041
steps:
4142
- name: Checkout.

.github/workflows/mutation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- ubuntu-latest
3535

3636
php:
37-
- 8.3
37+
- 8.4
3838

3939
services:
4040
oci:

.github/workflows/rector.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
os: >-
2020
['ubuntu-latest']
2121
php: >-
22-
['8.3']
22+
['8.4']

.github/workflows/static.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ jobs:
3535
- ubuntu-latest
3636

3737
php:
38-
- '8.1'
39-
- '8.2'
40-
- '8.3'
38+
- 8.1
39+
- 8.2
40+
- 8.3
41+
- 8.4
4142

4243
steps:
4344
- name: Checkout.

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
- New #301: Add `IndexType` class (@Tigrov)
3434
- New #303: Support JSON type (@Tigrov)
3535
- Bug #305: Explicitly mark nullable parameters (@vjik)
36+
- Chg #306: Change supported PHP versions to `8.1 - 8.4` (@Tigrov)
37+
- Enh #306: Minor refactoring (@Tigrov)
3638
- New #307: Add parameters `$ifExists` and `$cascade` to `CommandInterface::dropTable()` and
3739
`DDLQueryBuilderInterface::dropTable()` methods (@vjik)
3840

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ your Oracle database and perform various database operations as needed.
3131

3232
| PHP | Oracle Version | CI-Actions |
3333
|---------------|----------------|------------|
34-
| **8.1 - 8.3** | **12c - 21c**|[![build](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/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-oracle%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-oracle/master) [![static analysis](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-oracle/coverage.svg)](https://shepherd.dev/github/yiisoft/db-oracle)
34+
| **8.1 - 8.4** | **12c - 21c**|[![build](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/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-oracle%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-oracle/master) [![static analysis](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-oracle/coverage.svg)](https://shepherd.dev/github/yiisoft/db-oracle)
3535

3636
## Installation
3737

composer.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@
3131
],
3232
"require": {
3333
"ext-pdo": "*",
34-
"php": "^8.1",
34+
"php": "8.1 - 8.4",
3535
"yiisoft/db": "dev-master"
3636
},
3737
"require-dev": {
38-
"maglnet/composer-require-checker": "^4.2",
39-
"phpunit/phpunit": "^10.0",
40-
"rector/rector": "^2.0",
41-
"roave/infection-static-analysis-plugin": "^1.16",
42-
"spatie/phpunit-watcher": "^1.23",
43-
"vimeo/psalm": "^5.25",
44-
"vlucas/phpdotenv": "^5.6",
38+
"maglnet/composer-require-checker": "^4.7.1",
39+
"phpunit/phpunit": "^10.5.45",
40+
"rector/rector": "^2.0.10",
41+
"roave/infection-static-analysis-plugin": "^1.35",
42+
"spatie/phpunit-watcher": "^1.24",
43+
"vimeo/psalm": "^5.26.1 || ^6.8.8",
44+
"vlucas/phpdotenv": "^5.6.1",
4545
"yiisoft/aliases": "^2.0",
46-
"yiisoft/cache-file": "^3.1",
47-
"yiisoft/var-dumper": "^1.5"
46+
"yiisoft/cache-file": "^3.2",
47+
"yiisoft/var-dumper": "^1.7"
4848
},
4949
"autoload": {
5050
"psr-4": {

psalm.xml

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0"?>
22
<psalm
33
errorLevel="1"
4+
ensureOverrideAttribute="false"
45
findUnusedBaselineEntry="true"
56
findUnusedCode="false"
67
resolveFromConfigFile="true"
8+
strictBinaryOperands="false"
79
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
810
xmlns="https://getpsalm.org/schema/config"
911
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

src/Column/ColumnDefinitionParser.php

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

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

3537
$typeDetails = $matches[6] ?? $matches[2] ?? '';

src/Column/JsonColumn.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function phpTypecast(mixed $value): mixed
2828
}
2929

3030
if (is_resource($value)) {
31-
return json_decode(stream_get_contents($value), true, 512, JSON_THROW_ON_ERROR);
31+
/** @var string */
32+
$value = stream_get_contents($value);
33+
return json_decode($value, true, 512, JSON_THROW_ON_ERROR);
3234
}
3335

3436
return $value;

src/Command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
final class Command extends AbstractPdoCommand
2323
{
24-
public function insertWithReturningPks(string $table, array $columns): bool|array
24+
public function insertWithReturningPks(string $table, array $columns): array|false
2525
{
2626
$tableSchema = $this->db->getSchema()->getTableSchema($table);
2727
$returnColumns = $tableSchema?->getPrimaryKey() ?? [];

src/Schema.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ protected function getTableSequenceName(string $tableName): string|null
446446
*/
447447
private function loadColumn(array $info): ColumnInterface
448448
{
449-
$dbType = strtolower(preg_replace('/\([^)]+\)/', '', $info['data_type']));
449+
/** @var string $dbType */
450+
$dbType = preg_replace('/\([^)]+\)/', '', $info['data_type']);
451+
$dbType = strtolower($dbType);
450452

451453
match ($dbType) {
452454
'timestamp',

tests/CommandTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ public function testCreateView(): void
228228
)->execute();
229229
$command->setSql(
230230
<<<SQL
231-
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateTable_SEQ.NEXTVAL, 1)
231+
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateViewTable_SEQ.NEXTVAL, 1)
232232
SQL,
233233
)->execute();
234234
$command->setSql(
235235
<<<SQL
236-
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateTable_SEQ.NEXTVAL, 6)
236+
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateViewTable_SEQ.NEXTVAL, 6)
237237
SQL,
238238
)->execute();
239239
$command->createView('{{testCreateView}}', $subquery)->execute();
@@ -640,12 +640,12 @@ public function testQueryScalarWithBlob(): void
640640
$this->assertEquals($value, $scalarValue);
641641
}
642642

643-
public function testProfiler(string $sql = null): void
643+
public function testProfiler(string|null $sql = null): void
644644
{
645645
parent::testProfiler('SELECT 123 FROM DUAL');
646646
}
647647

648-
public function testProfilerData(string $sql = null): void
648+
public function testProfilerData(string|null $sql = null): void
649649
{
650650
parent::testProfilerData('SELECT 123 FROM DUAL');
651651
}

tests/QuoterTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testQuoteColumnName(string $columnName, string $expected): void
3838
public function testQuoteSimpleColumnName(
3939
string $columnName,
4040
string $expectedQuotedColumnName,
41-
string $expectedUnQuotedColumnName = null
41+
string|null $expectedUnQuotedColumnName = null
4242
): void {
4343
parent::testQuoteSimpleColumnName($columnName, $expectedQuotedColumnName, $expectedUnQuotedColumnName);
4444
}

0 commit comments

Comments
 (0)