Skip to content

Commit 189336d

Browse files
committed
Up to 8.1 min and new composer libraries
1 parent 7798ddd commit 189336d

9 files changed

+34
-32
lines changed

Diff for: .github/workflows/coding-standards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
name: "Coding Standards"
1616
uses: "doctrine/.github/.github/workflows/[email protected]"
1717
with:
18-
php-version: '8.0'
18+
php-version: '8.1'
1919
composer-options: '--prefer-dist --ignore-platform-req=php'
2020

Diff for: .github/workflows/continuous-integration.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
php-version:
22-
- "8.0"
2322
- "8.1"
23+
- "8.2"
24+
- "8.3"
2425
dependencies:
2526
- "highest"
2627
optional-dependencies:
2728
- true
2829
- false
2930
include:
30-
- php-version: "8.0"
31+
- php-version: "8.1"
3132
dependencies: "lowest"
3233
optional-dependencies: false
33-
- php-version: "8.0"
34+
- php-version: "8.1"
3435
dependencies: "lowest"
3536
optional-dependencies: true
3637

Diff for: .github/workflows/php.yml

-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,3 @@ jobs:
2828
2929
- name: Install dependencies
3030
run: composer install --prefer-dist --no-progress
31-
32-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
33-
# Docs: https://getcomposer.org/doc/articles/scripts.md
34-
35-
# - name: Run test suite
36-
# run: composer run-script test

Diff for: .github/workflows/static-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
2020
with:
21-
php-version: '8.0'
21+
php-version: '8.1'
2222
- uses: actions/checkout@v2
2323
- name: Install Dependencies
2424
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://github.com/API-Skeletons/laravel-api-problem/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/API-Skeletons/laravel-api-problem/actions/workflows/continuous-integration.yml?query=branch%3Amain)
44
[![Code Coverage](https://codecov.io/gh/API-Skeletons/laravel-api-problem/branch/main/graphs/badge.svg)](https://codecov.io/gh/API-Skeletons/laravel-api-problem/branch/main)
5-
[![PHP Version](https://img.shields.io/badge/PHP-8.0%2b-blue)](https://img.shields.io/badge/PHP-8.0%2b-blue)
5+
[![PHP Version](https://img.shields.io/badge/PHP-8.1%2b-blue)](https://img.shields.io/badge/PHP-8.1%2b-blue)
66
[![Total Downloads](https://poser.pugx.org/api-skeletons/laravel-api-problem/downloads)](//packagist.org/packages/api-skeletons/laravel-api-problem)
77
[![License](https://poser.pugx.org/api-skeletons/laravel-api-problem/license)](//packagist.org/packages/api-skeletons/laravel-api-problem)
88

Diff for: composer.json

+15-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"chat": "https://gitter.im/API-Skeletons/open-source"
1717
},
1818
"config": {
19-
"sort-packages": true
19+
"sort-packages": true,
20+
"allow-plugins": {
21+
"dealerdirect/phpcodesniffer-composer-installer": true
22+
}
2023
},
2124
"autoload": {
2225
"psr-4": {
@@ -42,16 +45,22 @@
4245
}
4346
},
4447
"scripts": {
45-
"test": "vendor/bin/phpcs && vendor/bin/phpunit && vendor/bin/psalm"
48+
"test": [
49+
"vendor/bin/parallel-lint src test",
50+
"vendor/bin/phpcs",
51+
"vendor/bin/psalm",
52+
"vendor/bin/phpunit"
53+
]
4654
},
4755
"require": {
48-
"php": "^8.0",
56+
"php": "^8.1",
4957
"doctrine/instantiator": "^1.4",
50-
"laravel/framework": "^8.0||^9.0"
58+
"laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0"
5159
},
5260
"require-dev": {
53-
"doctrine/coding-standard": "^9.0",
54-
"orchestra/testbench": "^6.23",
61+
"doctrine/coding-standard": "^12.0",
62+
"orchestra/testbench": "^7.41",
63+
"php-parallel-lint/php-parallel-lint": "^1.4",
5564
"phpunit/phpunit": "^9.5",
5665
"vimeo/psalm": "^4.15"
5766
}

Diff for: src/ApiProblem.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ApiProblem
5959
/**
6060
* HTTP status for the error.
6161
*/
62-
protected ?int $status = null;
62+
protected int|null $status = null;
6363

6464
/**
6565
* Normalized property names for overloading.
@@ -123,7 +123,7 @@ class ApiProblem
123123
/**
124124
* Title of the error.
125125
*/
126-
protected ?string $title;
126+
protected string|null $title;
127127

128128
/**
129129
* Create an instance using the provided information. If nothing is
@@ -133,7 +133,7 @@ class ApiProblem
133133
*
134134
* @param string[] $additional
135135
*/
136-
public function __construct(int|string $status, string|Throwable $detail, ?string $type = null, ?string $title = null, array $additional = [])
136+
public function __construct(int|string $status, string|Throwable $detail, string|null $type = null, string|null $title = null, array $additional = [])
137137
{
138138
if ($detail instanceof ProblemExceptionInterface) {
139139
if ($type === null) {
@@ -193,7 +193,7 @@ public function __get(string $name): mixed
193193

194194
throw new InvalidArgumentException(sprintf(
195195
'Invalid property name "%s"',
196-
$name
196+
$name,
197197
));
198198
}
199199

@@ -277,7 +277,7 @@ protected function getDetail(): string
277277
* If an exception was provided, creates the status code from it;
278278
* otherwise, code as provided is used.
279279
*/
280-
protected function getStatus(): ?int
280+
protected function getStatus(): int|null
281281
{
282282
if ($this->detail instanceof Throwable || $this->detail instanceof Exception) {
283283
$this->status = (int) $this->createStatusFromException();

Diff for: src/Exception/DomainException.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ class DomainException extends \DomainException implements
1010
ExceptionInterface,
1111
ProblemExceptionInterface
1212
{
13-
protected ?string $type = null;
13+
protected string|null $type = null;
1414

1515
/** @var string[] */
1616
protected array $details = [];
1717

18-
protected ?string $title = null;
18+
protected string|null $title = null;
1919

20-
/**
21-
* @param string[] $details
22-
*/
20+
/** @param string[] $details */
2321
public function setAdditionalDetails(array $details): self
2422
{
2523
$this->details = $details;
@@ -46,12 +44,12 @@ public function getAdditionalDetails(): Traversable|array|null
4644
return $this->details;
4745
}
4846

49-
public function getType(): ?string
47+
public function getType(): string|null
5048
{
5149
return $this->type;
5250
}
5351

54-
public function getTitle(): ?string
52+
public function getTitle(): string|null
5553
{
5654
return $this->title;
5755
}

Diff for: src/Exception/ProblemExceptionInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface ProblemExceptionInterface
1313
{
1414
public function getAdditionalDetails(): array|Traversable|null;
1515

16-
public function getType(): ?string;
16+
public function getType(): string|null;
1717

18-
public function getTitle(): ?string;
18+
public function getTitle(): string|null;
1919
}

0 commit comments

Comments
 (0)