Skip to content

Commit b6f0539

Browse files
committed
PHP: upgrade to v8.3 [WIP - readonly]
1 parent 48142d2 commit b6f0539

20 files changed

+140
-142
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
final class GetFieldTypesBenchmark extends BenchmarkCase
1010
{
11-
private const COLUMNS = [
11+
private const array COLUMNS = [
1212
'col1' => 1,
1313
'col2' => 2,
1414
'col3' => 3,

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.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>

src/Db/DataTypeCaches/DbLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
abstract class DbLoader implements Db\DataTypeCache
88
{
9-
private const LOAD_QUERY = 'SELECT oid, typname FROM pg_catalog.pg_type';
9+
private const string LOAD_QUERY = 'SELECT oid, typname FROM pg_catalog.pg_type';
1010

1111

1212
/**

src/Db/Exceptions/ConnectionException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
class ConnectionException extends Exception
66
{
7-
public const NO_CONFIG = 1;
8-
public const CANT_CHANGE_CONNECTION_CONFIG_WHEN_CONNECTED = 2;
9-
public const CONNECTION_FAILED = 3;
10-
public const BAD_CONNECTION = 4;
11-
public const CANT_GET_NOTICES = 5;
12-
public const ASYNC_CANCEL_FAILED = 6;
13-
public const ASYNC_QUERY_SENT_FAILED = 7;
14-
public const ASYNC_NO_QUERY_IS_SENT = 8;
15-
public const ASYNC_NO_EXECUTE_IS_SENT = 9;
16-
public const ASYNC_ANOTHER_QUERY_IS_RUNNING = 10;
7+
public const int NO_CONFIG = 1;
8+
public const int CANT_CHANGE_CONNECTION_CONFIG_WHEN_CONNECTED = 2;
9+
public const int CONNECTION_FAILED = 3;
10+
public const int BAD_CONNECTION = 4;
11+
public const int CANT_GET_NOTICES = 5;
12+
public const int ASYNC_CANCEL_FAILED = 6;
13+
public const int ASYNC_QUERY_SENT_FAILED = 7;
14+
public const int ASYNC_NO_QUERY_IS_SENT = 8;
15+
public const int ASYNC_NO_EXECUTE_IS_SENT = 9;
16+
public const int ASYNC_ANOTHER_QUERY_IS_RUNNING = 10;
1717

1818

1919
public static function noConfig(): self

src/Db/Exceptions/DataTypeCacheException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class DataTypeCacheException extends Exception
66
{
7-
public const CANT_LOAD_TYPES = 1;
7+
public const int CANT_LOAD_TYPES = 1;
88

99

1010
public static function cantLoadTypes(string $error): self

src/Db/Exceptions/DataTypeParserException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
class DataTypeParserException extends Exception
66
{
7-
public const CANT_PARSE_TYPE = 1;
8-
public const VALUE_IS_NOT_ARRAY = 2;
9-
public const CANT_CONVERT_DATETIME = 3;
10-
public const TRY_USE_CONVERT_TO_JSON = 4;
7+
public const int CANT_PARSE_TYPE = 1;
8+
public const int VALUE_IS_NOT_ARRAY = 2;
9+
public const int CANT_CONVERT_DATETIME = 3;
10+
public const int TRY_USE_CONVERT_TO_JSON = 4;
1111

1212

1313
public static function cantParseType(string $type, string $value): self

0 commit comments

Comments
 (0)