Skip to content

Commit 7ed6f1d

Browse files
committed
PHP: upgrade to v8.3
1 parent 0b1607c commit 7ed6f1d

31 files changed

+176
-185
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php-versions: ['8.1', '8.2', '8.3', '8.4']
15+
php-versions: ['8.3', '8.4']
1616
fail-fast: false
1717

1818
services:

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2
2424
with:
25-
php-version: 8.2
25+
php-version: 8.3
2626
coverage: none
2727
tools: composer:v2
2828

benchmarks/BasicPhpBenchmark.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
final class BasicPhpBenchmark extends BenchmarkCase
1010
{
11-
private const CONDITION = 1;
12-
private const ARRAY = [1];
13-
private const NULL_ARRAY = null;
11+
private const int CONDITION = 1;
12+
private const array ARRAY = [1];
13+
private const null NULL_ARRAY = null;
1414

1515
protected int $defaultRepeat = 1000000;
1616

17-
private const TEST_ARRAY = [1, 2, 3];
17+
private const array TEST_ARRAY = [1, 2, 3];
1818

1919
private \Closure $updateFunction;
2020

benchmarks/GetFieldTypesBenchmark.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
namespace Forrest79\PhPgSql\Benchmarks;
44

5+
use Forrest79\PhPgSql\Tests\Helper;
56
use PgSql;
67

78
require __DIR__ . '/bootstrap.php';
89

910
final class GetFieldTypesBenchmark extends BenchmarkCase
1011
{
11-
private const COLUMNS = [
12+
private const array COLUMNS = [
1213
'col1' => 1,
1314
'col2' => 2,
1415
'col3' => 3,
@@ -33,7 +34,7 @@ protected function setUp(): void
3334
{
3435
parent::setUp();
3536

36-
$connection = \pg_connect(\phpgsqlConnectionConfig());
37+
$connection = \pg_connect(Helper::connectionConfig());
3738
if ($connection === false) {
3839
throw new \RuntimeException('pg_connect failed');
3940
}

benchmarks/PdoBenchmark.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Forrest79\PhPgSql\Benchmarks;
44

5+
use Forrest79\PhPgSql\Tests\Helper;
56
use PgSql;
67

78
require __DIR__ . '/bootstrap.php';
@@ -25,13 +26,13 @@ protected function setUp(): void
2526
{
2627
parent::setUp();
2728

28-
$connection = \pg_connect(\phpgsqlConnectionConfig());
29+
$connection = \pg_connect(Helper::connectionConfig());
2930
if ($connection === false) {
3031
throw new \RuntimeException('pg_connect failed');
3132
}
3233
$this->connection = $connection;
3334

34-
$pdoConfig = 'pgsql:' . \str_replace(' ', ';', \phpgsqlConnectionConfig());
35+
$pdoConfig = 'pgsql:' . \str_replace(' ', ';', Helper::connectionConfig());
3536

3637
$this->pdo = new \PDO($pdoConfig);
3738

benchmarks/PgQueryBenchmark.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Forrest79\PhPgSql\Benchmarks;
44

5+
use Forrest79\PhPgSql\Tests\Helper;
56
use PgSql;
67

78
require __DIR__ . '/bootstrap.php';
@@ -15,7 +16,7 @@ protected function setUp(): void
1516
{
1617
parent::setUp();
1718

18-
$connection = \pg_connect(\phpgsqlConnectionConfig());
19+
$connection = \pg_connect(Helper::connectionConfig());
1920
if ($connection === false) {
2021
throw new \RuntimeException('pg_connect failed');
2122
}

benchmarks/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88
}
99

1010
require $loader;
11-
12-
require_once __DIR__ . '/../tests/prepare-db-config.php';

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^8.1",
15-
"ext-pgsql": "^8.1"
14+
"php": "^8.3",
15+
"ext-pgsql": "^8.3"
1616
},
1717
"require-dev": {
1818
"forrest79/phpcs": "^2.0",

phpcs-ignores.neon

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ ignoreErrors:
6161

6262
-
6363
sniff: PSR1.Files.SideEffects.FoundWithSymbols
64-
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 7.'
64+
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 8.'
6565
count: 1
6666
path: benchmarks/GetFieldTypesBenchmark.php
6767

6868
-
6969
sniff: PSR1.Files.SideEffects.FoundWithSymbols
70-
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 7.'
70+
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 8.'
7171
count: 1
7272
path: benchmarks/PdoBenchmark.php
7373

7474
-
7575
sniff: PSR1.Files.SideEffects.FoundWithSymbols
76-
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 7.'
76+
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 8.'
7777
count: 1
7878
path: benchmarks/PgQueryBenchmark.php
7979

@@ -592,15 +592,3 @@ ignoreErrors:
592592
message: 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 14 and the first side effect is on line 9.'
593593
count: 1
594594
path: tests/Unit/QueryTest.php
595-
596-
-
597-
sniff: SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceAfterDeclare
598-
message: 'Expected 1 line after declare statement, found 2.'
599-
count: 1
600-
path: tests/prepare-db-config.php
601-
602-
-
603-
sniff: Squiz.Functions.GlobalFunction.Found
604-
message: 'Consider putting global function "phpgsqlConnectionConfig" in a static class'
605-
count: 1
606-
path: tests/prepare-db-config.php

phpcs.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="PhpFpmRequest">
3-
<rule ref="./vendor/forrest79/phpcs/Forrest79CodingStandard/ruleset.xml">
4-
<exclude name="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint.MissingNativeTypeHint"/><!-- PHP 8.3+ -->
5-
</rule>
3+
<rule ref="./vendor/forrest79/phpcs/Forrest79CodingStandard/ruleset.xml"/>
64

75
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
86
<properties>

0 commit comments

Comments
 (0)