Skip to content

Commit

Permalink
PHP 8.4 support (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Graham Campbell <[email protected]>
  • Loading branch information
GrahamCampbell authored Feb 7, 2025
1 parent 45c5e1b commit 6bdec7c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
codesniffer:
name: PHP CodeSniffer
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -24,7 +24,7 @@ jobs:
update: true

- name: Install Dependencies
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand All @@ -51,7 +51,7 @@ jobs:
update: true

- name: Install Dependencies
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

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

- name: Install Dependencies
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"guzzlehttp/psr7": "^2.4.3",
"php-http/discovery": "^1.15.2",
"phpunit/phpunit": "^9.6.3 || ^10.0.12",
"psalm/phar": "5.7.6",
"psalm/phar": "5.26.1",
"psr/http-factory": "^1.0.1",
"psr/http-message": "^1.0.1",
"squizlabs/php_codesniffer": "3.7.2"
Expand Down
9 changes: 9 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="src/Http/Unmarshaller.php">
<DocblockTypeContradiction>
<code><![CDATA[sprintf('application/cloudevents+%s', $type)]]></code>
<code><![CDATA[sprintf('application/cloudevents-batch+%s', $type)]]></code>
</DocblockTypeContradiction>
</file>
</files>
3 changes: 3 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/InvalidAttributeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class InvalidAttributeException extends Exception
{
public function __construct(
string $message = null,
?string $message = null,
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message ?? 'Invalid CloudEvent attribute.', $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/InvalidPayloadSyntaxException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class InvalidPayloadSyntaxException extends Exception
{
public function __construct(
string $message = null,
?string $message = null,
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message ?? 'Invalid CloudEvent payload syntax.', $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/MissingAttributeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class MissingAttributeException extends Exception
{
public function __construct(
string $message = null,
?string $message = null,
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message ?? 'Missing CloudEvent attribute.', $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/UnsupportedContentTypeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class UnsupportedContentTypeException extends Exception
{
public function __construct(
string $message = null,
?string $message = null,
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message ?? 'Unsupported CloudEvent content type.', $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/UnsupportedSpecVersionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class UnsupportedSpecVersionException extends Exception
{
public function __construct(
string $message = null,
?string $message = null,
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message ?? 'Unsupported CloudEvent spec version.', $code, $previous);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Marshaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function __construct(
}

public static function createJsonMarshaller(
RequestFactoryInterface $requestFactory = null,
ResponseFactoryInterface $responseFactory = null,
StreamFactoryInterface $streamFactory = null
?RequestFactoryInterface $requestFactory = null,
?ResponseFactoryInterface $responseFactory = null,
?StreamFactoryInterface $streamFactory = null
): self {
return new self(
['serializer' => JsonSerializer::create(), 'type' => 'json'],
Expand Down

0 comments on commit 6bdec7c

Please sign in to comment.