Skip to content

Commit 6bdec7c

Browse files
PHP 8.4 support (#57)
Signed-off-by: Graham Campbell <[email protected]>
1 parent 45c5e1b commit 6bdec7c

11 files changed

+32
-20
lines changed

.github/workflows/static.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
codesniffer:
1010
name: PHP CodeSniffer
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212

1313
steps:
1414
- name: Checkout code
@@ -24,7 +24,7 @@ jobs:
2424
update: true
2525

2626
- name: Install Dependencies
27-
uses: nick-invision/retry@v2
27+
uses: nick-invision/retry@v3
2828
with:
2929
timeout_minutes: 5
3030
max_attempts: 5
@@ -51,7 +51,7 @@ jobs:
5151
update: true
5252

5353
- name: Install Dependencies
54-
uses: nick-invision/retry@v2
54+
uses: nick-invision/retry@v3
5555
with:
5656
timeout_minutes: 5
5757
max_attempts: 5

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
jobs:
99
tests:
1010
name: PHP ${{ matrix.php }}
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212

1313
strategy:
1414
matrix:
15-
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
15+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
1616

1717
steps:
1818
- name: Checkout Code
@@ -31,7 +31,7 @@ jobs:
3131
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
3232

3333
- name: Install Dependencies
34-
uses: nick-invision/retry@v2
34+
uses: nick-invision/retry@v3
3535
with:
3636
timeout_minutes: 5
3737
max_attempts: 5

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"guzzlehttp/psr7": "^2.4.3",
2828
"php-http/discovery": "^1.15.2",
2929
"phpunit/phpunit": "^9.6.3 || ^10.0.12",
30-
"psalm/phar": "5.7.6",
30+
"psalm/phar": "5.26.1",
3131
"psr/http-factory": "^1.0.1",
3232
"psr/http-message": "^1.0.1",
3333
"squizlabs/php_codesniffer": "3.7.2"

psalm-baseline.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
3+
<file src="src/Http/Unmarshaller.php">
4+
<DocblockTypeContradiction>
5+
<code><![CDATA[sprintf('application/cloudevents+%s', $type)]]></code>
6+
<code><![CDATA[sprintf('application/cloudevents-batch+%s', $type)]]></code>
7+
</DocblockTypeContradiction>
8+
</file>
9+
</files>

psalm.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
errorBaseline="psalm-baseline.xml"
9+
findUnusedBaselineEntry="true"
10+
findUnusedCode="false"
811
>
912
<projectFiles>
1013
<directory name="src" />

src/Exceptions/InvalidAttributeException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class InvalidAttributeException extends Exception
1111
{
1212
public function __construct(
13-
string $message = null,
13+
?string $message = null,
1414
int $code = 0,
15-
Throwable $previous = null
15+
?Throwable $previous = null
1616
) {
1717
parent::__construct($message ?? 'Invalid CloudEvent attribute.', $code, $previous);
1818
}

src/Exceptions/InvalidPayloadSyntaxException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class InvalidPayloadSyntaxException extends Exception
1111
{
1212
public function __construct(
13-
string $message = null,
13+
?string $message = null,
1414
int $code = 0,
15-
Throwable $previous = null
15+
?Throwable $previous = null
1616
) {
1717
parent::__construct($message ?? 'Invalid CloudEvent payload syntax.', $code, $previous);
1818
}

src/Exceptions/MissingAttributeException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class MissingAttributeException extends Exception
1111
{
1212
public function __construct(
13-
string $message = null,
13+
?string $message = null,
1414
int $code = 0,
15-
Throwable $previous = null
15+
?Throwable $previous = null
1616
) {
1717
parent::__construct($message ?? 'Missing CloudEvent attribute.', $code, $previous);
1818
}

src/Exceptions/UnsupportedContentTypeException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class UnsupportedContentTypeException extends Exception
1111
{
1212
public function __construct(
13-
string $message = null,
13+
?string $message = null,
1414
int $code = 0,
15-
Throwable $previous = null
15+
?Throwable $previous = null
1616
) {
1717
parent::__construct($message ?? 'Unsupported CloudEvent content type.', $code, $previous);
1818
}

src/Exceptions/UnsupportedSpecVersionException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class UnsupportedSpecVersionException extends Exception
1111
{
1212
public function __construct(
13-
string $message = null,
13+
?string $message = null,
1414
int $code = 0,
15-
Throwable $previous = null
15+
?Throwable $previous = null
1616
) {
1717
parent::__construct($message ?? 'Unsupported CloudEvent spec version.', $code, $previous);
1818
}

src/Http/Marshaller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function __construct(
4343
}
4444

4545
public static function createJsonMarshaller(
46-
RequestFactoryInterface $requestFactory = null,
47-
ResponseFactoryInterface $responseFactory = null,
48-
StreamFactoryInterface $streamFactory = null
46+
?RequestFactoryInterface $requestFactory = null,
47+
?ResponseFactoryInterface $responseFactory = null,
48+
?StreamFactoryInterface $streamFactory = null
4949
): self {
5050
return new self(
5151
['serializer' => JsonSerializer::create(), 'type' => 'json'],

0 commit comments

Comments
 (0)