diff --git a/composer.json b/composer.json index c3194ac..2cc0a91 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "testcontainers/testcontainers": "1.0.4" }, "require-dev": { - "phpstan/phpstan": "2.1.38", + "phpstan/phpstan": "2.1.39", "phpunit/phpunit": "11.5.50", "rector/rector": "2.3.6", "symplify/easy-coding-standard": "13.0.4" diff --git a/composer.lock b/composer.lock index 09efe9f..e06c04d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0b7909a1dd9581152b3b26ce74eb1d74", + "content-hash": "e0a42e89969976fa862d78e30f78943a", "packages": [ { "name": "beluga-php/docker-php", @@ -223,16 +223,16 @@ }, { "name": "jane-php/json-schema-runtime", - "version": "v7.10.3", + "version": "v7.10.4", "source": { "type": "git", "url": "https://github.com/janephp/json-schema-runtime.git", - "reference": "92335453340f21c1be220a308a48b55b066458dc" + "reference": "f1f96868836e7b9cfa45eb40d3afcd989f079a3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/janephp/json-schema-runtime/zipball/92335453340f21c1be220a308a48b55b066458dc", - "reference": "92335453340f21c1be220a308a48b55b066458dc", + "url": "https://api.github.com/repos/janephp/json-schema-runtime/zipball/f1f96868836e7b9cfa45eb40d3afcd989f079a3a", + "reference": "f1f96868836e7b9cfa45eb40d3afcd989f079a3a", "shasum": "" }, "require": { @@ -279,22 +279,22 @@ ], "description": "Jane runtime Library", "support": { - "source": "https://github.com/janephp/json-schema-runtime/tree/v7.10.3" + "source": "https://github.com/janephp/json-schema-runtime/tree/v7.10.4" }, - "time": "2025-12-08T13:24:37+00:00" + "time": "2026-01-12T19:55:34+00:00" }, { "name": "jane-php/open-api-runtime", - "version": "v7.10.3", + "version": "v7.10.4", "source": { "type": "git", "url": "https://github.com/janephp/open-api-runtime.git", - "reference": "771138eea41580a48e6d9f6a00f9a8f92c01ec1f" + "reference": "825670a6cbd0e2b8246af0c1b15ce4b986318942" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/janephp/open-api-runtime/zipball/771138eea41580a48e6d9f6a00f9a8f92c01ec1f", - "reference": "771138eea41580a48e6d9f6a00f9a8f92c01ec1f", + "url": "https://api.github.com/repos/janephp/open-api-runtime/zipball/825670a6cbd0e2b8246af0c1b15ce4b986318942", + "reference": "825670a6cbd0e2b8246af0c1b15ce4b986318942", "shasum": "" }, "require": { @@ -342,26 +342,26 @@ ], "description": "Jane OpenAPI Runtime Library, dependencies and utility class for a library generated by jane/openapi", "support": { - "source": "https://github.com/janephp/open-api-runtime/tree/v7.10.3" + "source": "https://github.com/janephp/open-api-runtime/tree/v7.10.4" }, - "time": "2025-12-08T13:24:37+00:00" + "time": "2026-01-12T19:55:34+00:00" }, { "name": "league/uri", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri.git", - "reference": "8d587cddee53490f9b82bf203d3a9aa7ea4f9807" + "reference": "4436c6ec8d458e4244448b069cc572d088230b76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/8d587cddee53490f9b82bf203d3a9aa7ea4f9807", - "reference": "8d587cddee53490f9b82bf203d3a9aa7ea4f9807", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/4436c6ec8d458e4244448b069cc572d088230b76", + "reference": "4436c6ec8d458e4244448b069cc572d088230b76", "shasum": "" }, "require": { - "league/uri-interfaces": "^7.7", + "league/uri-interfaces": "^7.8", "php": "^8.1", "psr/http-factory": "^1" }, @@ -375,11 +375,11 @@ "ext-gmp": "to improve IPV4 host parsing", "ext-intl": "to handle IDN host with the best performance", "ext-uri": "to use the PHP native URI class", - "jeremykendall/php-domain-parser": "to resolve Public Suffix and Top Level Domain", - "league/uri-components": "Needed to easily manipulate URI objects components", - "league/uri-polyfill": "Needed to backport the PHP URI extension for older versions of PHP", + "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain", + "league/uri-components": "to provide additional tools to manipulate URI objects components", + "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP", "php-64bit": "to improve IPV4 host parsing", - "rowbot/url": "to handle WHATWG URL", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" }, "type": "library", @@ -434,7 +434,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri/tree/7.7.0" + "source": "https://github.com/thephpleague/uri/tree/7.8.0" }, "funding": [ { @@ -442,20 +442,20 @@ "type": "github" } ], - "time": "2025-12-07T16:02:06+00:00" + "time": "2026-01-14T17:24:56+00:00" }, { "name": "league/uri-interfaces", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "62ccc1a0435e1c54e10ee6022df28d6c04c2946c" + "reference": "c5c5cd056110fc8afaba29fa6b72a43ced42acd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/62ccc1a0435e1c54e10ee6022df28d6c04c2946c", - "reference": "62ccc1a0435e1c54e10ee6022df28d6c04c2946c", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/c5c5cd056110fc8afaba29fa6b72a43ced42acd4", + "reference": "c5c5cd056110fc8afaba29fa6b72a43ced42acd4", "shasum": "" }, "require": { @@ -468,7 +468,7 @@ "ext-gmp": "to improve IPV4 host parsing", "ext-intl": "to handle IDN host with the best performance", "php-64bit": "to improve IPV4 host parsing", - "rowbot/url": "to handle WHATWG URL", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" }, "type": "library", @@ -518,7 +518,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/7.7.0" + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.0" }, "funding": [ { @@ -526,7 +526,7 @@ "type": "github" } ], - "time": "2025-12-07T16:03:21+00:00" + "time": "2026-01-15T06:54:53+00:00" }, { "name": "nyholm/psr7", @@ -1950,16 +1950,16 @@ }, { "name": "symfony/serializer", - "version": "v7.4.3", + "version": "v7.4.5", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "af01e99d6fc63549063fb9e849ce1240cfef5c4a" + "reference": "480cd1237c98ab1219c20945b92c9d4480a44f47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/af01e99d6fc63549063fb9e849ce1240cfef5c4a", - "reference": "af01e99d6fc63549063fb9e849ce1240cfef5c4a", + "url": "https://api.github.com/repos/symfony/serializer/zipball/480cd1237c98ab1219c20945b92c9d4480a44f47", + "reference": "480cd1237c98ab1219c20945b92c9d4480a44f47", "shasum": "" }, "require": { @@ -1969,8 +1969,8 @@ "symfony/polyfill-php84": "^1.30" }, "conflict": { - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", + "phpdocumentor/reflection-docblock": "<5.2|>=6", + "phpdocumentor/type-resolver": "<1.5.1", "symfony/dependency-injection": "<6.4", "symfony/property-access": "<6.4", "symfony/property-info": "<6.4", @@ -1979,7 +1979,7 @@ "symfony/yaml": "<6.4" }, "require-dev": { - "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", + "phpdocumentor/reflection-docblock": "^5.2", "phpstan/phpdoc-parser": "^1.0|^2.0", "seld/jsonlint": "^1.10", "symfony/cache": "^6.4|^7.0|^8.0", @@ -2029,7 +2029,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v7.4.3" + "source": "https://github.com/symfony/serializer/tree/v7.4.5" }, "funding": [ { @@ -2049,7 +2049,7 @@ "type": "tidelift" } ], - "time": "2025-12-23T14:50:43+00:00" + "time": "2026-01-27T08:59:58+00:00" }, { "name": "symfony/translation-contracts", @@ -2135,16 +2135,16 @@ }, { "name": "symfony/validator", - "version": "v7.4.3", + "version": "v7.4.5", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "9670bedf4c454b21d1e04606b6c227990da8bebe" + "reference": "fcec92c40df1c93507857da08226005573b655c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/9670bedf4c454b21d1e04606b6c227990da8bebe", - "reference": "9670bedf4c454b21d1e04606b6c227990da8bebe", + "url": "https://api.github.com/repos/symfony/validator/zipball/fcec92c40df1c93507857da08226005573b655c6", + "reference": "fcec92c40df1c93507857da08226005573b655c6", "shasum": "" }, "require": { @@ -2215,7 +2215,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v7.4.3" + "source": "https://github.com/symfony/validator/tree/v7.4.5" }, "funding": [ { @@ -2235,7 +2235,7 @@ "type": "tidelift" } ], - "time": "2025-12-27T17:05:22+00:00" + "time": "2026-01-27T08:59:58+00:00" }, { "name": "symfony/yaml", @@ -2612,11 +2612,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.38", + "version": "2.1.39", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dfaf1f530e1663aa167bc3e52197adb221582629", - "reference": "dfaf1f530e1663aa167bc3e52197adb221582629", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6f73a2af4cbcd99c931d0fb8f08548cc0fa8224", + "reference": "c6f73a2af4cbcd99c931d0fb8f08548cc0fa8224", "shasum": "" }, "require": { @@ -2661,7 +2661,7 @@ "type": "github" } ], - "time": "2026-01-30T17:12:46+00:00" + "time": "2026-02-11T14:48:56+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2755,28 +2755,28 @@ }, { "name": "phpunit/php-file-iterator", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2804,15 +2804,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" } ], - "time": "2024-08-27T05:02:59+00:00" + "time": "2026-02-02T13:52:54+00:00" }, { "name": "phpunit/php-invoker", @@ -4329,5 +4341,5 @@ "ext-sodium": "*" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/src/SigningKey.php b/src/SigningKey.php index cd9b1bc..255ac28 100644 --- a/src/SigningKey.php +++ b/src/SigningKey.php @@ -83,16 +83,25 @@ private function generatePem(string $key, string $type): string private function encodeLength(int $length): string { if ($length < 0x80) { - return chr($length); + return $this->chr($length); } $lenBytes = ltrim(pack('N', $length), "\x00"); - return chr(0x80 | strlen($lenBytes)) . $lenBytes; + return $this->chr(0x80 | strlen($lenBytes)) . $lenBytes; } private function asn1(int $tag, string $value): string { - return chr($tag) . $this->encodeLength(strlen($value)) . $value; + return $this->chr($tag) . $this->encodeLength(strlen($value)) . $value; + } + + private function chr(int $code): string + { + if ($code < 0 || $code > 255) { + throw new RuntimeException('Code must be between 0 and 255.'); + } + + return chr($code); } private function encodePkcs8(string $key): string diff --git a/src/Stream/CurlMultiHandler.php b/src/Stream/CurlMultiHandler.php index 49c691a..1814b0d 100644 --- a/src/Stream/CurlMultiHandler.php +++ b/src/Stream/CurlMultiHandler.php @@ -114,7 +114,6 @@ public function contentIterator(): iterable curl_multi_remove_handle($curlMultiHandle, $curlHandle); curl_multi_close($curlMultiHandle); - curl_close($curlHandle); unset( $this->curlHandle,