Skip to content

Commit 870af17

Browse files
authored
Add actual php versions to gitlab action matrix (#27)
* Add actual php versions to gitlab action matrix * Downgrade cebe/openapi version: get issue after 1.6 with null nullable. * drop php 7.4 support * Change dependencies constraints * replace cebe/php-openapi with league/openapi-psr7-validator used fork * Replace neomerx/json-api with laravel-json-api maintained fork, update ramsey/uuid to php 8.1 support version, fix warnings in test * Allow doctrine usage 3
1 parent be6041c commit 870af17

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ jobs:
77
strategy:
88
matrix:
99
php:
10-
- 7.4
1110
- 8.0
11+
- 8.1
12+
- 8.2
13+
- 8.3
1214
prefer:
1315
- lowest
1416
- stable

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Changed
1616
- Best composer dependencies compatibility: allow more versions
1717

18+
## Removed
19+
- php 7.4 support
20+
1821
## [0.0.13] - 2021-01-27
1922
### Added
2023
- TraceIntoDetailsExplainingErrorFactory for catched ErrorHandler exceptions debug. Note: not for production usage

composer.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"require": {
1515
"ext-intl": "*",
1616
"ext-json": "*",
17-
"cebe/php-openapi": "^1.4",
18-
"doctrine/persistence": "^2.0",
17+
"devizzent/cebe-php-openapi": "^1.0",
18+
"doctrine/persistence": "^2.0|^3.0",
1919
"fig/http-message-util": "^1.0",
2020
"free-elephants/i18n": "^0.0.1",
2121
"laminas/laminas-stratigility": "^3.2",
22-
"league/openapi-psr7-validator": "0.14|^0.15|^0.16",
23-
"neomerx/json-api": "^4.0",
22+
"laravel-json-api/neomerx-json-api": "^5.0.2",
23+
"league/openapi-psr7-validator": "0.19 - 0.22",
2424
"nette/php-generator": "^3.4",
2525
"nikic/fast-route": "^1.3",
2626
"psr/cache": "^1|^2|^3",
@@ -30,16 +30,13 @@
3030
"psr/http-server-handler": "^1.0",
3131
"psr/http-server-middleware": "^1.0",
3232
"rakit/validation": "^1.2",
33-
"ramsey/uuid": "^3.0|^4.0"
33+
"ramsey/uuid": "^3.9.7|^4.0"
3434
},
3535
"require-dev": {
3636
"helmich/phpunit-psr7-assert": "^4",
3737
"nyholm/psr7": "^1.2",
3838
"phpunit/phpunit": "^9.0"
3939
},
40-
"conflict": {
41-
"cebe/php-openapi": "1.5.0 || 1.5.1"
42-
},
4340
"suggest": {
4441
"doctrine/orm": "^2.7",
4542
"free-elephants/di": "*",

phpunit.xml.dist

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@
1212
<php>
1313
<ini name="error_reporting" value="E_ALL"/>
1414
</php>
15-
<testsuites>
16-
<testsuite name="8.0">
17-
<directory suffix="TestPHP8.php" phpVersion="8.0">./tests</directory>
15+
<testsuite name="">
16+
<directory>tests/</directory>
1817
</testsuite>
19-
<testsuite name="7.4">
20-
<directory suffix="Test.php" phpVersion="7.4">./tests</directory>
21-
</testsuite>
22-
</testsuites>
2318
<logging/>
2419
</phpunit>

src/FreeElephants/JsonApiToolkit/DTO/AbstractResourceObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(array $data)
3333
$reflectionType = $relationshipsProperty->getType();
3434

3535
// handle php 8 union types
36-
if (class_exists(\ReflectionUnionType::class) && $reflectionType instanceof \ReflectionUnionType) {
36+
if ($reflectionType instanceof \ReflectionUnionType) {
3737
$relationshipsClass = (new SuitableRelationshipsTypeDetector())->detect($reflectionType, $relationshipsData);
3838
} else {
3939
$relationshipsClass = $reflectionType->getName();

tests/FreeElephants/JsonApiToolkit/DTO/Reflection/SuitableRelationshipsTypeDetectorTestPHP8.php renamed to tests/FreeElephants/JsonApiToolkit/DTO/Reflection/SuitableRelationshipsTypeDetectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use FreeElephants\JsonApiToolkit\DTO\RelationshipToOne;
1010
use ReflectionProperty;
1111

12-
class SuitableRelationshipsTypeDetectorTestPHP8 extends AbstractTestCase
12+
class SuitableRelationshipsTypeDetectorTest extends AbstractTestCase
1313
{
1414

1515
public function testDetect()

tests/FreeElephants/JsonApiToolkit/Psr/ErrorFactoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public function testFromThrowable()
1919

2020
$throwable = new Exception('Hello, world!', 100500);
2121
$request = $this->createMock(ServerRequestInterface::class);
22+
// Prevent return null instead string
23+
$request->method('getHeaderLine')->willReturn('');
2224

2325
$errorFactory = new ErrorFactory($translatorRegistry);
2426
$error = $errorFactory->fromThrowable($throwable, 200, $request, ['pointer']);
@@ -37,6 +39,8 @@ public function testCreateError()
3739
$translatorRegistry->method('getTranslator')->willReturn($translator);
3840

3941
$request = $this->createMock(ServerRequestInterface::class);
42+
// Prevent return null instead string
43+
$request->method('getHeaderLine')->willReturn('');
4044

4145
$errorFactory = new ErrorFactory($translatorRegistry);
4246
$error = $errorFactory->createError('Hello, world!', 200, $request, ['pointer']);

0 commit comments

Comments
 (0)