Skip to content

Commit

Permalink
Drop support for PHP 8.0 and run CI for PHP 8.3 (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-georgiev authored Jan 11, 2024
1 parent 58c1fab commit 7e99e11
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.0'
continue-on-error: true
- php: '8.1'
- php: '8.2'
- php: '8.3'
ignore-php-version: true
calculate-code-coverage: true

Expand All @@ -31,7 +30,7 @@ jobs:
- name: Set up PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php || '8.2' }}
php-version: ${{ matrix.php || '8.3' }}
coverage: xdebug
extensions: ctype, json, mbstring
tools: composer
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
environment:
php: 8.1
php: 8.2

coding_style:
php:
Expand Down
7 changes: 4 additions & 3 deletions ci/rector/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector;
use Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

Expand All @@ -32,10 +32,11 @@
$rectorConfig->import(SetList::EARLY_RETURN);
$rectorConfig->import(SetList::NAMING);
$rectorConfig->import(SetList::PHP_80);
$rectorConfig->import(SetList::PHP_81);
$rectorConfig->import(SetList::TYPE_DECLARATION);

$rectorConfig->import(DoctrineSetList::DOCTRINE_25);
$rectorConfig->import(DoctrineSetList::DOCTRINE_ORM_25);
$rectorConfig->import(DoctrineSetList::DOCTRINE_CODE_QUALITY);

$rectorConfig->import(LevelSetList::UP_TO_PHP_80);
$rectorConfig->import(LevelSetList::UP_TO_PHP_81);
};
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},

"require": {
"php": "^8.0",
"php": "^8.1",
"ext-ctype": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand All @@ -52,11 +52,11 @@
"phpstan/phpstan-phpunit": "^1.3.14",
"phpunit/phpunit": "^9.6.11",
"qossmic/deptrac-shim": "^0.24||^1.0",
"rector/rector": "^0.18.1",
"rector/rector": "^0.19",
"symfony/cache": "^5.0||^6.0"
},
"suggest": {
"php": "^8.2",
"php": "^8.3",
"doctrine/orm": "~2.5||~3.0"
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
*
* @author Martin Georgiev <[email protected]>
*/
abstract class TypeException extends \Exception
{
}
abstract class TypeException extends \Exception {}
2 changes: 1 addition & 1 deletion src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function transformToPostgresJson(mixed $phpValue): string
return $postgresValue;
}

protected function transformFromPostgresJson(string $postgresValue): array|bool|float|int|string|null
protected function transformFromPostgresJson(string $postgresValue): null|array|bool|float|int|string
{
// @phpstan-ignore-next-line
return \json_decode($postgresValue, true, 512, JSON_THROW_ON_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
*
* @param string|null $value the value to convert
*/
public function convertToPHPValue($value, AbstractPlatform $platform): array|bool|float|int|string|null
public function convertToPHPValue($value, AbstractPlatform $platform): null|array|bool|float|int|string
{
if ($value === null) {
return null;
Expand Down
6 changes: 3 additions & 3 deletions tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void

/**
* @return list<array{
* phpValue: array|bool|float|int|string|null,
* phpValue: null|array|bool|float|int|string,
* postgresValue: string|null
* }>
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ public function has_name(): void
*
* @dataProvider provideValidTransformations
*/
public function can_transform_from_php_value(array|bool|float|int|string|null $phpValue, ?string $postgresValue): void
public function can_transform_from_php_value(null|array|bool|float|int|string $phpValue, ?string $postgresValue): void
{
$this->assertEquals($postgresValue, $this->fixture->convertToDatabaseValue($phpValue, $this->platform));
}
Expand All @@ -98,7 +98,7 @@ public function can_transform_from_php_value(array|bool|float|int|string|null $p
*
* @dataProvider provideValidTransformations
*/
public function can_transform_to_php_value(array|bool|float|int|string|null $phpValue, ?string $postgresValue): void
public function can_transform_to_php_value(null|array|bool|float|int|string $phpValue, ?string $postgresValue): void
{
$this->assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
}
Expand Down

0 comments on commit 7e99e11

Please sign in to comment.