diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 4f22379..9d5539c 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -8,7 +8,7 @@ on:
jobs:
codesniffer:
name: PHP CodeSniffer
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout code
@@ -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
@@ -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
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5e2e15f..0183705 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -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
@@ -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
diff --git a/composer.json b/composer.json
index cba6b96..658dce4 100644
--- a/composer.json
+++ b/composer.json
@@ -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"
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
new file mode 100644
index 0000000..253f2ed
--- /dev/null
+++ b/psalm-baseline.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/psalm.xml.dist b/psalm.xml.dist
index db645bc..7ee17a8 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -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"
>
diff --git a/src/Exceptions/InvalidAttributeException.php b/src/Exceptions/InvalidAttributeException.php
index f8f9cac..65efd92 100644
--- a/src/Exceptions/InvalidAttributeException.php
+++ b/src/Exceptions/InvalidAttributeException.php
@@ -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);
}
diff --git a/src/Exceptions/InvalidPayloadSyntaxException.php b/src/Exceptions/InvalidPayloadSyntaxException.php
index 970f1c8..9a7ed8f 100644
--- a/src/Exceptions/InvalidPayloadSyntaxException.php
+++ b/src/Exceptions/InvalidPayloadSyntaxException.php
@@ -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);
}
diff --git a/src/Exceptions/MissingAttributeException.php b/src/Exceptions/MissingAttributeException.php
index 7118561..43e8668 100644
--- a/src/Exceptions/MissingAttributeException.php
+++ b/src/Exceptions/MissingAttributeException.php
@@ -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);
}
diff --git a/src/Exceptions/UnsupportedContentTypeException.php b/src/Exceptions/UnsupportedContentTypeException.php
index 0ed9493..bf8fd8c 100644
--- a/src/Exceptions/UnsupportedContentTypeException.php
+++ b/src/Exceptions/UnsupportedContentTypeException.php
@@ -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);
}
diff --git a/src/Exceptions/UnsupportedSpecVersionException.php b/src/Exceptions/UnsupportedSpecVersionException.php
index d6578d6..8525523 100644
--- a/src/Exceptions/UnsupportedSpecVersionException.php
+++ b/src/Exceptions/UnsupportedSpecVersionException.php
@@ -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);
}
diff --git a/src/Http/Marshaller.php b/src/Http/Marshaller.php
index 9aec3d3..48a077a 100644
--- a/src/Http/Marshaller.php
+++ b/src/Http/Marshaller.php
@@ -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'],