diff --git a/.travis.yml b/.travis.yml index e2bed3e..6fbd740 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ php: - "7.3" - "7.4" - "8.0" + - "8.1" + - "8.2" + - "8.3" + - "8.4" before_script: - "composer install" - "composer require php-coveralls/php-coveralls" diff --git a/composer.json b/composer.json index 630511d..a9a26f8 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,9 @@ "require-dev": { "phpunit/phpunit": "^8.1" }, + "conflict": { + "php": "8.2.26 || 8.3.14 || 8.4.1" + }, "autoload": { "psr-4": { "Sop\\ASN1\\": "lib/ASN1/" diff --git a/lib/ASN1/Component/Identifier.php b/lib/ASN1/Component/Identifier.php index 42d512f..069609f 100644 --- a/lib/ASN1/Component/Identifier.php +++ b/lib/ASN1/Component/Identifier.php @@ -85,7 +85,7 @@ public function __construct(int $class, int $pc, $tag) * * @return self */ - public static function fromDER(string $data, int &$offset = null): Identifier + public static function fromDER(string $data, ?int &$offset = null): Identifier { $idx = $offset ?? 0; $datalen = strlen($data); diff --git a/lib/ASN1/Component/Length.php b/lib/ASN1/Component/Length.php index 27216e8..fb74e8c 100644 --- a/lib/ASN1/Component/Length.php +++ b/lib/ASN1/Component/Length.php @@ -50,7 +50,7 @@ public function __construct($length, bool $indefinite = false) * * @throws DecodeException If decoding fails */ - public static function fromDER(string $data, int &$offset = null): self + public static function fromDER(string $data, ?int &$offset = null): self { $idx = $offset ?? 0; $datalen = strlen($data); @@ -98,7 +98,7 @@ public static function fromDER(string $data, int &$offset = null): self * @throws DecodeException If decoding or expectation fails */ public static function expectFromDER(string $data, int &$offset, - int $expected = null): self + ?int $expected = null): self { $idx = $offset; $length = self::fromDER($data, $idx); diff --git a/lib/ASN1/Element.php b/lib/ASN1/Element.php index 864fe36..38f99c8 100644 --- a/lib/ASN1/Element.php +++ b/lib/ASN1/Element.php @@ -198,7 +198,7 @@ abstract public function isConstructed(): bool; * @throws \UnexpectedValueException If called in the context of an expected * type, but decoding yields another type */ - public static function fromDER(string $data, int &$offset = null): ElementBase + public static function fromDER(string $data, ?int &$offset = null): ElementBase { $idx = $offset ?? 0; // decode identifier