From 5456677602406d52e2071c517b4a40e6978b24a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 5 May 2023 10:25:49 +0200 Subject: [PATCH] Update composer dependencies --- .../files/lib/system/api/composer.json | 4 +- .../files/lib/system/api/composer.lock | 56 ++--- .../system/api/composer/autoload_classmap.php | 1 - .../system/api/composer/autoload_files.php | 9 - .../system/api/composer/autoload_static.php | 10 - .../lib/system/api/composer/installed.json | 58 ++--- .../lib/system/api/composer/installed.php | 14 +- .../laminas/laminas-diactoros/composer.json | 28 +-- .../laminas-diactoros/src/CallbackStream.php | 12 +- .../laminas-diactoros/src/MessageTrait.php | 27 +- .../laminas-diactoros/src/PhpInputStream.php | 84 ------- .../laminas-diactoros/src/RelativeStream.php | 8 +- .../laminas/laminas-diactoros/src/Request.php | 2 +- .../laminas-diactoros/src/RequestTrait.php | 31 +-- .../laminas-diactoros/src/Response.php | 27 +- .../laminas-diactoros/src/ServerRequest.php | 18 +- .../src/ServerRequestFactory.php | 14 +- .../laminas/laminas-diactoros/src/Stream.php | 13 +- .../laminas-diactoros/src/StreamFactory.php | 4 +- .../laminas-diactoros/src/UploadedFile.php | 6 +- .../api/laminas/laminas-diactoros/src/Uri.php | 83 +------ .../functions/create_uploaded_file.legacy.php | 18 -- .../marshal_headers_from_sapi.legacy.php | 16 -- .../functions/marshal_headers_from_sapi.php | 13 +- .../marshal_method_from_sapi.legacy.php | 16 -- ...shal_protocol_version_from_sapi.legacy.php | 16 -- .../marshal_uri_from_sapi.legacy.php | 18 -- .../src/functions/marshal_uri_from_sapi.php | 233 ------------------ .../src/functions/normalize_server.legacy.php | 16 -- .../normalize_uploaded_files.legacy.php | 16 -- .../functions/parse_cookie_header.legacy.php | 19 -- .../system/api/psr/http-message/composer.json | 4 +- .../psr/http-message/src/MessageInterface.php | 24 +- .../psr/http-message/src/RequestInterface.php | 15 +- .../http-message/src/ResponseInterface.php | 8 +- .../src/ServerRequestInterface.php | 24 +- .../psr/http-message/src/StreamInterface.php | 28 +-- .../src/UploadedFileInterface.php | 14 +- .../api/psr/http-message/src/UriInterface.php | 34 ++- 39 files changed, 206 insertions(+), 835 deletions(-) delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/PhpInputStream.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php delete mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php diff --git a/wcfsetup/install/files/lib/system/api/composer.json b/wcfsetup/install/files/lib/system/api/composer.json index 9e54e06bb5..438aa9e32b 100644 --- a/wcfsetup/install/files/lib/system/api/composer.json +++ b/wcfsetup/install/files/lib/system/api/composer.json @@ -16,14 +16,14 @@ "ezyang/htmlpurifier": "^4.16", "guzzlehttp/guzzle": "^7.5.1", "guzzlehttp/psr7": "^2.5.0", - "laminas/laminas-diactoros": "^2.25.2", + "laminas/laminas-diactoros": "^3.0.0", "laminas/laminas-httphandlerrunner": "^2.6", "laminas/laminas-progressbar": "^2.11", "paragonie/constant_time_encoding": "^2.6.3", "pelago/emogrifier": "^7.0.0", "psr/clock": "^1.0", "psr/event-dispatcher": "^1.0", - "psr/http-message": "^1.1.0", + "psr/http-message": "^2.0", "psr/http-server-handler": "^1.0.2", "psr/http-server-middleware": "^1.0.2", "psr/log": "^3.0", diff --git a/wcfsetup/install/files/lib/system/api/composer.lock b/wcfsetup/install/files/lib/system/api/composer.lock index 92a6820325..4efd1db3aa 100644 --- a/wcfsetup/install/files/lib/system/api/composer.lock +++ b/wcfsetup/install/files/lib/system/api/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": "2983948012af211bf635948ccf965b06", + "content-hash": "84250bc88acacd285d9605a8b2ef00c7", "packages": [ { "name": "cuyz/valinor", @@ -581,29 +581,26 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.25.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" + "reference": "2515f4134258b1b418c23cb86606b8a09dd01aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/2515f4134258b1b418c23cb86606b8a09dd01aea", + "reference": "2515f4134258b1b418c23cb86606b8a09dd01aea", "shasum": "" }, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1" - }, - "conflict": { - "zendframework/zend-diactoros": "*" + "psr/http-factory": "^1.0.2", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" + "psr/http-factory-implementation": "^1.1 || ^2.0", + "psr/http-message-implementation": "^1.1 || ^2.0" }, "require-dev": { "ext-curl": "*", @@ -611,11 +608,11 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.5", - "php-http/psr7-integration-tests": "^1.2", + "laminas/laminas-coding-standard": "~2.5.0", + "php-http/psr7-integration-tests": "^1.3", "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.6" + "vimeo/psalm": "^5.9" }, "type": "library", "extra": { @@ -630,18 +627,9 @@ "src/functions/marshal_headers_from_sapi.php", "src/functions/marshal_method_from_sapi.php", "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", "src/functions/normalize_server.php", "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" + "src/functions/parse_cookie_header.php" ], "psr-4": { "Laminas\\Diactoros\\": "src/" @@ -674,7 +662,7 @@ "type": "community_bridge" } ], - "time": "2023-04-17T15:44:17+00:00" + "time": "2023-05-04T21:18:23+00:00" }, { "name": "laminas/laminas-httphandlerrunner", @@ -1215,16 +1203,16 @@ }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -1233,7 +1221,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1248,7 +1236,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -1262,9 +1250,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/http-server-handler", diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php b/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php index 3e0ffbb38e..341fb46d74 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php @@ -682,7 +682,6 @@ return array( 'Laminas\\Diactoros\\HeaderSecurity' => $vendorDir . '/laminas/laminas-diactoros/src/HeaderSecurity.php', 'Laminas\\Diactoros\\MessageTrait' => $vendorDir . '/laminas/laminas-diactoros/src/MessageTrait.php', 'Laminas\\Diactoros\\Module' => $vendorDir . '/laminas/laminas-diactoros/src/Module.php', - 'Laminas\\Diactoros\\PhpInputStream' => $vendorDir . '/laminas/laminas-diactoros/src/PhpInputStream.php', 'Laminas\\Diactoros\\RelativeStream' => $vendorDir . '/laminas/laminas-diactoros/src/RelativeStream.php', 'Laminas\\Diactoros\\Request' => $vendorDir . '/laminas/laminas-diactoros/src/Request.php', 'Laminas\\Diactoros\\RequestFactory' => $vendorDir . '/laminas/laminas-diactoros/src/RequestFactory.php', diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_files.php b/wcfsetup/install/files/lib/system/api/composer/autoload_files.php index a3cd434e5f..e716c03517 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_files.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_files.php @@ -15,17 +15,8 @@ return array( 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', 'e6f3bc6883e449ab367280b34158c05b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php', - 'd59fbae42019aedf227094ac49a46f50' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php', 'de95e0ac670b27c84ef8c5ac41fc1b34' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.php', 'b6c2870932b0250c10334a86dcb33c7f' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', 'd02cf21124526632320d6f20b1bbf905' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', - 'd919fc9d5ad52cfb7f322f7fe36458ab' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php', - 'e397f74f8af3b1e56166a6e99f216ee7' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php', - 'd154b49fab8e4da34fb553a2d644918c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php', - '9d3db23ca418094bcf0b641a0c9559ed' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php', - 'b0b88a3b89caae681462c58ff19a7059' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php', - 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', - '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', - '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', '5897ea0ac4cccf14d323035e65887801' => $vendorDir . '/symfony/polyfill-php82/bootstrap.php', ); diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_static.php b/wcfsetup/install/files/lib/system/api/composer/autoload_static.php index 1b52cf09ea..573489c0c5 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_static.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_static.php @@ -16,18 +16,9 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', 'e6f3bc6883e449ab367280b34158c05b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php', - 'd59fbae42019aedf227094ac49a46f50' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php', 'de95e0ac670b27c84ef8c5ac41fc1b34' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.php', 'b6c2870932b0250c10334a86dcb33c7f' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', 'd02cf21124526632320d6f20b1bbf905' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', - 'd919fc9d5ad52cfb7f322f7fe36458ab' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php', - 'e397f74f8af3b1e56166a6e99f216ee7' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php', - 'd154b49fab8e4da34fb553a2d644918c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php', - '9d3db23ca418094bcf0b641a0c9559ed' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php', - 'b0b88a3b89caae681462c58ff19a7059' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php', - 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', - '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', - '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', '5897ea0ac4cccf14d323035e65887801' => __DIR__ . '/..' . '/symfony/polyfill-php82/bootstrap.php', ); @@ -874,7 +865,6 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'Laminas\\Diactoros\\HeaderSecurity' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/HeaderSecurity.php', 'Laminas\\Diactoros\\MessageTrait' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/MessageTrait.php', 'Laminas\\Diactoros\\Module' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/Module.php', - 'Laminas\\Diactoros\\PhpInputStream' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/PhpInputStream.php', 'Laminas\\Diactoros\\RelativeStream' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/RelativeStream.php', 'Laminas\\Diactoros\\Request' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/Request.php', 'Laminas\\Diactoros\\RequestFactory' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/RequestFactory.php', diff --git a/wcfsetup/install/files/lib/system/api/composer/installed.json b/wcfsetup/install/files/lib/system/api/composer/installed.json index 41c5e11c15..e778d82f4f 100644 --- a/wcfsetup/install/files/lib/system/api/composer/installed.json +++ b/wcfsetup/install/files/lib/system/api/composer/installed.json @@ -596,30 +596,27 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.25.2", - "version_normalized": "2.25.2.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" + "reference": "2515f4134258b1b418c23cb86606b8a09dd01aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/2515f4134258b1b418c23cb86606b8a09dd01aea", + "reference": "2515f4134258b1b418c23cb86606b8a09dd01aea", "shasum": "" }, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1" - }, - "conflict": { - "zendframework/zend-diactoros": "*" + "psr/http-factory": "^1.0.2", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" + "psr/http-factory-implementation": "^1.1 || ^2.0", + "psr/http-message-implementation": "^1.1 || ^2.0" }, "require-dev": { "ext-curl": "*", @@ -627,13 +624,13 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.5", - "php-http/psr7-integration-tests": "^1.2", + "laminas/laminas-coding-standard": "~2.5.0", + "php-http/psr7-integration-tests": "^1.3", "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.6" + "vimeo/psalm": "^5.9" }, - "time": "2023-04-17T15:44:17+00:00", + "time": "2023-05-04T21:18:23+00:00", "type": "library", "extra": { "laminas": { @@ -648,18 +645,9 @@ "src/functions/marshal_headers_from_sapi.php", "src/functions/marshal_method_from_sapi.php", "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", "src/functions/normalize_server.php", "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" + "src/functions/parse_cookie_header.php" ], "psr-4": { "Laminas\\Diactoros\\": "src/" @@ -1260,27 +1248,27 @@ }, { "name": "psr/http-message", - "version": "1.1", - "version_normalized": "1.1.0.0", + "version": "2.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, - "time": "2023-04-04T09:50:52+00:00", + "time": "2023-04-04T09:54:51+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -1296,7 +1284,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -1310,7 +1298,7 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, "install-path": "../psr/http-message" }, diff --git a/wcfsetup/install/files/lib/system/api/composer/installed.php b/wcfsetup/install/files/lib/system/api/composer/installed.php index d4d3e92030..2c59e33b81 100644 --- a/wcfsetup/install/files/lib/system/api/composer/installed.php +++ b/wcfsetup/install/files/lib/system/api/composer/installed.php @@ -83,9 +83,9 @@ 'dev_requirement' => false, ), 'laminas/laminas-diactoros' => array( - 'pretty_version' => '2.25.2', - 'version' => '2.25.2.0', - 'reference' => '9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e', + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'reference' => '2515f4134258b1b418c23cb86606b8a09dd01aea', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', 'aliases' => array(), @@ -188,12 +188,13 @@ 'dev_requirement' => false, 'provided' => array( 0 => '1.0', + 1 => '^1.1 || ^2.0', ), ), 'psr/http-message' => array( - 'pretty_version' => '1.1', - 'version' => '1.1.0.0', - 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), @@ -203,6 +204,7 @@ 'dev_requirement' => false, 'provided' => array( 0 => '1.0', + 1 => '^1.1 || ^2.0', ), ), 'psr/http-server-handler' => array( diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/composer.json b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/composer.json index c141b38438..371b97de8e 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/composer.json +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/composer.json @@ -35,8 +35,8 @@ }, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1" + "psr/http-factory": "^1.0.2", + "psr/http-message": "^1.1 || ^2.0" }, "require-dev": { "ext-curl": "*", @@ -44,18 +44,15 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.5", - "php-http/psr7-integration-tests": "^1.2", + "laminas/laminas-coding-standard": "~2.5.0", + "php-http/psr7-integration-tests": "^1.3", "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.6" + "vimeo/psalm": "^5.9" }, "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "conflict": { - "zendframework/zend-diactoros": "*" + "psr/http-factory-implementation": "^1.1 || ^2.0", + "psr/http-message-implementation": "^1.1 || ^2.0" }, "autoload": { "files": [ @@ -63,18 +60,9 @@ "src/functions/marshal_headers_from_sapi.php", "src/functions/marshal_method_from_sapi.php", "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", "src/functions/normalize_server.php", "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" + "src/functions/parse_cookie_header.php" ], "psr-4": { "Laminas\\Diactoros\\": "src/" diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/CallbackStream.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/CallbackStream.php index cf344a15b9..11e10df15a 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/CallbackStream.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/CallbackStream.php @@ -97,12 +97,8 @@ class CallbackStream implements StreamInterface, Stringable /** * {@inheritdoc} - * - * @param int $offset - * @param int $whence - * @return void */ - public function seek($offset, $whence = SEEK_SET) + public function seek(int $offset, int $whence = SEEK_SET): void { throw Exception\UnseekableStreamException::forCallbackStream(); } @@ -126,7 +122,7 @@ class CallbackStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function write($string): void + public function write(string $string): int { throw Exception\UnwritableStreamException::forCallbackStream(); } @@ -142,7 +138,7 @@ class CallbackStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function read($length): string + public function read(int $length): string { throw Exception\UnreadableStreamException::forCallbackStream(); } @@ -160,7 +156,7 @@ class CallbackStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function getMetadata($key = null) + public function getMetadata(?string $key = null) { $metadata = [ 'eof' => $this->eof(), diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/MessageTrait.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/MessageTrait.php index 695b942eb1..e95d072a64 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/MessageTrait.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/MessageTrait.php @@ -10,10 +10,8 @@ use Psr\Http\Message\StreamInterface; use function array_map; use function array_merge; use function array_values; -use function gettype; use function implode; use function is_array; -use function is_object; use function is_resource; use function is_string; use function preg_match; @@ -76,7 +74,7 @@ trait MessageTrait * @param string $version HTTP protocol version * @return static */ - public function withProtocolVersion($version): MessageInterface + public function withProtocolVersion(string $version): MessageInterface { $this->validateProtocolVersion($version); $new = clone $this; @@ -119,7 +117,7 @@ trait MessageTrait * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - public function hasHeader($header): bool + public function hasHeader(string $header): bool { return isset($this->headerNames[strtolower($header)]); } @@ -138,7 +136,7 @@ trait MessageTrait * header. If the header does not appear in the message, this method MUST * return an empty array. */ - public function getHeader($header): array + public function getHeader(string $header): array { if (! $this->hasHeader($header)) { return []; @@ -168,7 +166,7 @@ trait MessageTrait * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - public function getHeaderLine($name): string + public function getHeaderLine(string $name): string { $value = $this->getHeader($name); if (empty($value)) { @@ -194,7 +192,7 @@ trait MessageTrait * @return static * @throws Exception\InvalidArgumentException For invalid header names or values. */ - public function withHeader($name, $value): MessageInterface + public function withHeader(string $name, $value): MessageInterface { $this->assertHeader($name); @@ -230,7 +228,7 @@ trait MessageTrait * @return static * @throws Exception\InvalidArgumentException For invalid header names or values. */ - public function withAddedHeader($name, $value): MessageInterface + public function withAddedHeader(string $name, $value): MessageInterface { $this->assertHeader($name); @@ -258,9 +256,9 @@ trait MessageTrait * @param string $name Case-insensitive header field name to remove. * @return static */ - public function withoutHeader($name): MessageInterface + public function withoutHeader(string $name): MessageInterface { - if (! is_string($name) || $name === '' || ! $this->hasHeader($name)) { + if ($name === '' || ! $this->hasHeader($name)) { return clone $this; } @@ -347,22 +345,15 @@ trait MessageTrait /** * Validate the HTTP protocol version * - * @param string $version * @throws Exception\InvalidArgumentException On invalid HTTP protocol version. */ - private function validateProtocolVersion($version): void + private function validateProtocolVersion(string $version): void { if (empty($version)) { throw new Exception\InvalidArgumentException( 'HTTP protocol version can not be empty' ); } - if (! is_string($version)) { - throw new Exception\InvalidArgumentException(sprintf( - 'Unsupported HTTP protocol version; must be a string, received %s', - is_object($version) ? $version::class : gettype($version) - )); - } // HTTP/1 uses a "." numbering scheme to indicate // versions of the protocol, while HTTP/2 does not. diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/PhpInputStream.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/PhpInputStream.php deleted file mode 100644 index cef45d6245..0000000000 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/PhpInputStream.php +++ /dev/null @@ -1,84 +0,0 @@ -reachedEof) { - return $this->cache; - } - - $this->getContents(); - return $this->cache; - } - - /** - * {@inheritdoc} - */ - public function isWritable(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function read($length): string - { - $content = parent::read($length); - if (! $this->reachedEof) { - $this->cache .= $content; - } - - if ($this->eof()) { - $this->reachedEof = true; - } - - return $content; - } - - /** - * {@inheritdoc} - */ - public function getContents($maxLength = -1): string - { - if ($this->reachedEof) { - return $this->cache; - } - - $contents = stream_get_contents($this->resource, $maxLength); - $this->cache .= $contents; - - if ($maxLength === -1 || $this->eof()) { - $this->reachedEof = true; - } - - return $contents; - } -} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RelativeStream.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RelativeStream.php index 0c12833ef9..d82457a067 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RelativeStream.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RelativeStream.php @@ -86,7 +86,7 @@ final class RelativeStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET): void + public function seek(int $offset, int $whence = SEEK_SET): void { if ($whence === SEEK_SET) { $this->decoratedStream->seek($offset + $this->offset, $whence); @@ -114,7 +114,7 @@ final class RelativeStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function write($string): int + public function write(string $string): int { if ($this->tell() < 0) { throw new Exception\InvalidStreamPointerPositionException(); @@ -133,7 +133,7 @@ final class RelativeStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function read($length): string + public function read(int $length): string { if ($this->tell() < 0) { throw new Exception\InvalidStreamPointerPositionException(); @@ -155,7 +155,7 @@ final class RelativeStream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function getMetadata($key = null) + public function getMetadata(?string $key = null) { return $this->decoratedStream->getMetadata($key); } diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Request.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Request.php index 504581c201..84f5fd9ea2 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Request.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Request.php @@ -52,7 +52,7 @@ class Request implements RequestInterface /** * {@inheritdoc} */ - public function getHeader($name): array + public function getHeader(string $name): array { if (empty($name) || ! $this->hasHeader($name)) { if ( diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RequestTrait.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RequestTrait.php index 3194682e9f..4ce4478b0e 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RequestTrait.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/RequestTrait.php @@ -9,8 +9,6 @@ use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; use function array_keys; -use function gettype; -use function is_object; use function is_string; use function preg_match; use function sprintf; @@ -89,23 +87,19 @@ trait RequestTrait * * Otherwise, it raises an exception. * - * @param null|string|UriInterface $uri * @throws Exception\InvalidArgumentException */ - private function createUri($uri): UriInterface + private function createUri(null|string|UriInterface $uri): UriInterface { if ($uri instanceof UriInterface) { return $uri; } + if (is_string($uri)) { return new Uri($uri); } - if ($uri === null) { - return new Uri(); - } - throw new Exception\InvalidArgumentException( - 'Invalid URI provided; must be null, a string, or a Psr\Http\Message\UriInterface instance' - ); + + return new Uri(); } /** @@ -155,11 +149,10 @@ trait RequestTrait * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various * request-target forms allowed in request messages) * - * @param string $requestTarget * @throws Exception\InvalidArgumentException If the request target is invalid. * @return static */ - public function withRequestTarget($requestTarget): RequestInterface + public function withRequestTarget(string $requestTarget): RequestInterface { if (preg_match('#\s#', $requestTarget)) { throw new Exception\InvalidArgumentException( @@ -197,7 +190,7 @@ trait RequestTrait * @throws Exception\InvalidArgumentException For invalid HTTP methods. * @return static */ - public function withMethod($method): RequestInterface + public function withMethod(string $method): RequestInterface { $new = clone $this; $new->setMethod($method); @@ -245,7 +238,7 @@ trait RequestTrait * @param bool $preserveHost Preserve the original state of the Host header. * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface + public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface { $new = clone $this; $new->uri = $uri; @@ -282,18 +275,10 @@ trait RequestTrait /** * Set and validate the HTTP method * - * @param string $method * @throws Exception\InvalidArgumentException On invalid HTTP method. */ - private function setMethod($method): void + private function setMethod(string $method): void { - if (! is_string($method)) { - throw new Exception\InvalidArgumentException(sprintf( - 'Unsupported HTTP method; must be a string, received %s', - is_object($method) ? $method::class : gettype($method) - )); - } - if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported HTTP method "%s" provided', diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Response.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Response.php index 0fc353d727..a99625da6a 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Response.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Response.php @@ -7,12 +7,6 @@ namespace Laminas\Diactoros; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; -use function gettype; -use function is_float; -use function is_numeric; -use function is_object; -use function is_scalar; -use function is_string; use function sprintf; /** @@ -144,7 +138,7 @@ class Response implements ResponseInterface /** * {@inheritdoc} */ - public function withStatus($code, $reasonPhrase = ''): Response + public function withStatus(int $code, string $reasonPhrase = ''): Response { $new = clone $this; $new->setStatusCode($code, $reasonPhrase); @@ -154,38 +148,27 @@ class Response implements ResponseInterface /** * Set a valid status code. * - * @param int $code - * @param string $reasonPhrase * @throws Exception\InvalidArgumentException On an invalid status code. */ - private function setStatusCode($code, $reasonPhrase = ''): void + private function setStatusCode(int $code, string $reasonPhrase = ''): void { if ( - ! is_numeric($code) - || is_float($code) - || $code < static::MIN_STATUS_CODE_VALUE + $code < static::MIN_STATUS_CODE_VALUE || $code > static::MAX_STATUS_CODE_VALUE ) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid status code "%s"; must be an integer between %d and %d, inclusive', - is_scalar($code) ? $code : gettype($code), + $code, static::MIN_STATUS_CODE_VALUE, static::MAX_STATUS_CODE_VALUE )); } - if (! is_string($reasonPhrase)) { - throw new Exception\InvalidArgumentException(sprintf( - 'Unsupported response reason phrase; must be a string, received %s', - is_object($reasonPhrase) ? $reasonPhrase::class : gettype($reasonPhrase) - )); - } - if ($reasonPhrase === '' && isset($this->phrases[$code])) { $reasonPhrase = $this->phrases[$code]; } $this->reasonPhrase = $reasonPhrase; - $this->statusCode = (int) $code; + $this->statusCode = $code; } } diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequest.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequest.php index 8fdfd4491a..8578a6e86d 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequest.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequest.php @@ -53,7 +53,7 @@ class ServerRequest implements ServerRequestInterface public function __construct( private array $serverParams = [], array $uploadedFiles = [], - $uri = null, + null|string|UriInterface $uri = null, ?string $method = null, $body = 'php://input', array $headers = [], @@ -65,7 +65,7 @@ class ServerRequest implements ServerRequestInterface $this->validateUploadedFiles($uploadedFiles); if ($body === 'php://input') { - $body = new PhpInputStream(); + $body = new Stream($body, 'r'); } $this->initialize($uri, $method, $body, $headers); @@ -173,29 +173,29 @@ class ServerRequest implements ServerRequestInterface /** * {@inheritdoc} */ - public function getAttribute($attribute, $default = null) + public function getAttribute(string $name, $default = null) { - if (! array_key_exists($attribute, $this->attributes)) { + if (! array_key_exists($name, $this->attributes)) { return $default; } - return $this->attributes[$attribute]; + return $this->attributes[$name]; } /** * {@inheritdoc} */ - public function withAttribute($attribute, $value): ServerRequest + public function withAttribute(string $name, $value): ServerRequest { - $new = clone $this; - $new->attributes[$attribute] = $value; + $new = clone $this; + $new->attributes[$name] = $value; return $new; } /** * {@inheritdoc} */ - public function withoutAttribute($name): ServerRequest + public function withoutAttribute(string $name): ServerRequest { $new = clone $this; unset($new->attributes[$name]); diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequestFactory.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequestFactory.php index 5c6718e34b..ca176e1482 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequestFactory.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/ServerRequestFactory.php @@ -53,14 +53,14 @@ class ServerRequestFactory implements ServerRequestFactoryInterface ?array $cookies = null, ?array $files = null, ?FilterServerRequestInterface $requestFilter = null - ): ServerRequest { - $requestFilter = $requestFilter ?: FilterUsingXForwardedHeaders::trustReservedSubnets(); + ): ServerRequestInterface { + $requestFilter = $requestFilter ?? FilterUsingXForwardedHeaders::trustReservedSubnets(); $server = normalizeServer( - $server ?: $_SERVER, + $server ?? $_SERVER, is_callable(self::$apacheRequestHeaders) ? self::$apacheRequestHeaders : null ); - $files = normalizeUploadedFiles($files ?: $_FILES); + $files = normalizeUploadedFiles($files ?? $_FILES); $headers = marshalHeadersFromSapi($server); if (null === $cookies && array_key_exists('cookie', $headers)) { @@ -74,9 +74,9 @@ class ServerRequestFactory implements ServerRequestFactoryInterface marshalMethodFromSapi($server), 'php://input', $headers, - $cookies ?: $_COOKIE, - $query ?: $_GET, - $body ?: $_POST, + $cookies ?? $_COOKIE, + $query ?? $_GET, + $body ?? $_POST, marshalProtocolVersionFromSapi($server) )); } diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Stream.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Stream.php index 96c0982ebd..2af1bb8bce 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Stream.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Stream.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Laminas\Diactoros; -use GdImage; use Psr\Http\Message\StreamInterface; use RuntimeException; use Stringable; @@ -39,7 +38,7 @@ class Stream implements StreamInterface, Stringable /** * A list of allowed stream resource types that are allowed to instantiate a Stream */ - private const ALLOWED_STREAM_RESOURCE_TYPES = ['gd', 'stream']; + private const ALLOWED_STREAM_RESOURCE_TYPES = ['stream']; /** @var resource|null */ protected $resource; @@ -174,7 +173,7 @@ class Stream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET): void + public function seek(int $offset, int $whence = SEEK_SET): void { if (! $this->resource) { throw Exception\UnseekableStreamException::dueToMissingResource(); @@ -258,7 +257,7 @@ class Stream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function read($length): string + public function read(int $length): string { if (! $this->resource) { throw Exception\UnreadableStreamException::dueToMissingResource(); @@ -296,7 +295,7 @@ class Stream implements StreamInterface, Stringable /** * {@inheritdoc} */ - public function getMetadata($key = null) + public function getMetadata(?string $key = null) { if (null === $key) { return stream_get_meta_data($this->resource); @@ -358,10 +357,6 @@ class Stream implements StreamInterface, Stringable return in_array(get_resource_type($resource), self::ALLOWED_STREAM_RESOURCE_TYPES, true); } - if ($resource instanceof GdImage) { - return true; - } - return false; } } diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/StreamFactory.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/StreamFactory.php index 54596dbaee..8efca29501 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/StreamFactory.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/StreamFactory.php @@ -28,9 +28,9 @@ class StreamFactory implements StreamFactoryInterface /** * {@inheritDoc} */ - public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface + public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface { - return new Stream($file, $mode); + return new Stream($filename, $mode); } /** diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/UploadedFile.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/UploadedFile.php index 50407365e3..354b04280d 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/UploadedFile.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/UploadedFile.php @@ -59,7 +59,7 @@ class UploadedFile implements UploadedFileInterface */ public function __construct( $streamOrFile, - private int $size, + private ?int $size, int $errorStatus, private ?string $clientFilename = null, private ?string $clientMediaType = null @@ -125,7 +125,7 @@ class UploadedFile implements UploadedFileInterface * @throws Exception\UploadedFileErrorException On any error during the * move operation, or on the second or subsequent call to the method. */ - public function moveTo($targetPath): void + public function moveTo(string $targetPath): void { if ($this->moved) { throw new Exception\UploadedFileAlreadyMovedException('Cannot move file; already moved!'); @@ -137,7 +137,7 @@ class UploadedFile implements UploadedFileInterface ); } - if (! is_string($targetPath) || empty($targetPath)) { + if (empty($targetPath)) { throw new Exception\InvalidArgumentException( 'Invalid path provided for move operation; must be a non-empty string' ); diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Uri.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Uri.php index 59f776eee8..0c35fdc6f4 100644 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Uri.php +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/Uri.php @@ -10,12 +10,7 @@ use Stringable; use function array_keys; use function explode; -use function gettype; use function implode; -use function is_float; -use function is_numeric; -use function is_object; -use function is_string; use function ltrim; use function parse_url; use function preg_match; @@ -220,16 +215,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withScheme($scheme): UriInterface + public function withScheme(string $scheme): UriInterface { - if (! is_string($scheme)) { - throw new Exception\InvalidArgumentException(sprintf( - '%s expects a string argument; received %s', - __METHOD__, - is_object($scheme) ? $scheme::class : gettype($scheme) - )); - } - $scheme = $this->filterScheme($scheme); if ($scheme === $this->scheme) { @@ -255,25 +242,10 @@ class Uri implements UriInterface, Stringable * {@inheritdoc} */ public function withUserInfo( - $user, + string $user, #[SensitiveParameter] - $password = null + ?string $password = null ): UriInterface { - if (! is_string($user)) { - throw new Exception\InvalidArgumentException(sprintf( - '%s expects a string user argument; received %s', - __METHOD__, - is_object($user) ? $user::class : gettype($user) - )); - } - if (null !== $password && ! is_string($password)) { - throw new Exception\InvalidArgumentException(sprintf( - '%s expects a string or null password argument; received %s', - __METHOD__, - is_object($password) ? $password::class : gettype($password) - )); - } - $info = $this->filterUserInfoPart($user); if (null !== $password) { $info .= ':' . $this->filterUserInfoPart($password); @@ -295,16 +267,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withHost($host): UriInterface + public function withHost(string $host): UriInterface { - if (! is_string($host)) { - throw new Exception\InvalidArgumentException(sprintf( - '%s expects a string argument; received %s', - __METHOD__, - is_object($host) ? $host::class : gettype($host) - )); - } - if ($host === $this->host) { // Do nothing if no change was made. return $this; @@ -319,19 +283,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withPort($port): UriInterface + public function withPort(?int $port): UriInterface { - if ($port !== null) { - if (! is_numeric($port) || is_float($port)) { - throw new Exception\InvalidArgumentException(sprintf( - 'Invalid port "%s" specified; must be an integer, an integer string, or null', - is_object($port) ? $port::class : gettype($port) - )); - } - - $port = (int) $port; - } - if ($port === $this->port) { // Do nothing if no change was made. return $this; @@ -353,14 +306,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withPath($path): UriInterface + public function withPath(string $path): UriInterface { - if (! is_string($path)) { - throw new Exception\InvalidArgumentException( - 'Invalid path provided; must be a string' - ); - } - if (str_contains($path, '?')) { throw new Exception\InvalidArgumentException( 'Invalid path provided; must not contain a query string' @@ -389,14 +336,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withQuery($query): UriInterface + public function withQuery(string $query): UriInterface { - if (! is_string($query)) { - throw new Exception\InvalidArgumentException( - 'Query string must be a string' - ); - } - if (str_contains($query, '#')) { throw new Exception\InvalidArgumentException( 'Query string must not include a URI fragment' @@ -419,16 +360,8 @@ class Uri implements UriInterface, Stringable /** * {@inheritdoc} */ - public function withFragment($fragment): UriInterface + public function withFragment(string $fragment): UriInterface { - if (! is_string($fragment)) { - throw new Exception\InvalidArgumentException(sprintf( - '%s expects a string argument; received %s', - __METHOD__, - is_object($fragment) ? $fragment::class : gettype($fragment) - )); - } - $fragment = $this->filterFragment($fragment); if ($fragment === $this->fragment) { diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php deleted file mode 100644 index fff753ff53..0000000000 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php +++ /dev/null @@ -1,18 +0,0 @@ - Header/value pairs */ function marshalHeadersFromSapi(array $server): array { @@ -30,7 +33,7 @@ function marshalHeadersFromSapi(array $server): array $headers = []; foreach ($server as $key => $value) { - if (! is_string($key)) { + if (! is_string($key) || $key === '') { continue; } @@ -63,5 +66,9 @@ function marshalHeadersFromSapi(array $server): array } } - return $headers; + // Filter out integer keys. + // These can occur if the translated header name is a string integer. + // PHP will cast those to integers when assigned to an array. + // This filters them out. + return array_filter($headers, fn(string|int $key): bool => is_string($key), ARRAY_FILTER_USE_KEY); } diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php deleted file mode 100644 index 2eb83d97ab..0000000000 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php +++ /dev/null @@ -1,16 +0,0 @@ -withScheme($scheme); - - // Set the host - [$host, $port] = $marshalHostAndPort($headers, $server); - if (! empty($host)) { - $uri = $uri->withHost($host); - if (! empty($port)) { - $uri = $uri->withPort($port); - } - } - - // URI path - $path = $marshalRequestPath($server); - - // Strip query string - $path = explode('?', $path, 2)[0]; - - // URI query - $query = ''; - if (isset($server['QUERY_STRING'])) { - $query = ltrim($server['QUERY_STRING'], '?'); - } - - // URI fragment - $fragment = ''; - if (str_contains($path, '#')) { - $parts = explode('#', $path, 2); - assert(count($parts) >= 2); - [$path, $fragment] = $parts; - } - - return $uri - ->withPath($path) - ->withFragment($fragment) - ->withQuery($query); -} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php deleted file mode 100644 index b355c4d889..0000000000 --- a/wcfsetup/install/files/lib/system/api/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php +++ /dev/null @@ -1,16 +0,0 @@ - key/value cookie pairs. - */ -function parseCookieHeader($cookieHeader): array -{ - return laminas_parseCookieHeader(...func_get_args()); -} diff --git a/wcfsetup/install/files/lib/system/api/psr/http-message/composer.json b/wcfsetup/install/files/lib/system/api/psr/http-message/composer.json index 56e8c0a6db..c66e5aba40 100644 --- a/wcfsetup/install/files/lib/system/api/psr/http-message/composer.json +++ b/wcfsetup/install/files/lib/system/api/psr/http-message/composer.json @@ -7,7 +7,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/wcfsetup/install/files/lib/system/api/psr/http-message/src/MessageInterface.php b/wcfsetup/install/files/lib/system/api/psr/http-message/src/MessageInterface.php index 8cdb4ed63a..a83c98518d 100644 --- a/wcfsetup/install/files/lib/system/api/psr/http-message/src/MessageInterface.php +++ b/wcfsetup/install/files/lib/system/api/psr/http-message/src/MessageInterface.php @@ -1,7 +1,5 @@