diff --git a/lam/composer.lock b/lam/composer.lock index dc2827614..16b67925e 100644 --- a/lam/composer.lock +++ b/lam/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": "394ecca423d9ac192d65b0a187c88899", + "content-hash": "568be4a9b4d554bdddabd243fac3a598", "packages": [ { "name": "beberlei/assert", @@ -742,16 +742,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -766,8 +766,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -838,7 +838,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -854,7 +854,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -916,16 +916,16 @@ }, { "name": "illuminate/collections", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "f9589f1063a449111dcaa1d68285b507d9483a95" + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/f9589f1063a449111dcaa1d68285b507d9483a95", - "reference": "f9589f1063a449111dcaa1d68285b507d9483a95", + "url": "https://api.github.com/repos/illuminate/collections/zipball/37c863cffb345869dd134eff8e646bc82a19cc96", + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96", "shasum": "" }, "require": { @@ -967,11 +967,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-03-20T20:09:13+00:00" + "time": "2024-06-19T14:25:05+00:00" }, { "name": "illuminate/conditionable", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -1017,7 +1017,7 @@ }, { "name": "illuminate/contracts", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1065,7 +1065,7 @@ }, { "name": "illuminate/macroable", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1111,7 +1111,7 @@ }, { "name": "illuminate/pagination", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -1161,16 +1161,16 @@ }, { "name": "illuminate/support", - "version": "v10.48.12", + "version": "v10.48.20", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "263f389d81488c237846b69469f91387ca2729f3" + "reference": "56c6d9895605b019e3debb9440454596ef99312a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/263f389d81488c237846b69469f91387ca2729f3", - "reference": "263f389d81488c237846b69469f91387ca2729f3", + "url": "https://api.github.com/repos/illuminate/support/zipball/56c6d9895605b019e3debb9440454596ef99312a", + "reference": "56c6d9895605b019e3debb9440454596ef99312a", "shasum": "" }, "require": { @@ -1228,20 +1228,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-05-16T21:33:51+00:00" + "time": "2024-05-20T13:31:33+00:00" }, { "name": "monolog/monolog", - "version": "3.6.0", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654" + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", - "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8", + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8", "shasum": "" }, "require": { @@ -1317,7 +1317,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.6.0" + "source": "https://github.com/Seldaek/monolog/tree/3.7.0" }, "funding": [ { @@ -1329,7 +1329,7 @@ "type": "tidelift" } ], - "time": "2024-04-12T21:02:21+00:00" + "time": "2024-06-28T09:40:51+00:00" }, { "name": "nesbot/carbon", @@ -1721,20 +1721,20 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.37", + "version": "3.0.41", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8" + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8", - "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/621c73f7dcb310b61de34d1da4c4204e8ace6ceb", + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "^1|^2", + "paragonie/constant_time_encoding": "^1|^2|^3", "paragonie/random_compat": "^1.4|^2.0|^9.99.99", "php": ">=5.6.1" }, @@ -1811,7 +1811,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.37" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.41" }, "funding": [ { @@ -1827,7 +1827,7 @@ "type": "tidelift" } ], - "time": "2024-03-03T02:14:58+00:00" + "time": "2024-08-12T00:13:54+00:00" }, { "name": "psr/clock", @@ -2205,16 +2205,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "79dff0b268932c640297f5208d6298f71855c03e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e", + "reference": "79dff0b268932c640297f5208d6298f71855c03e", "shasum": "" }, "require": { @@ -2249,9 +2249,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.1" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-08-21T13:31:24+00:00" }, { "name": "psr/simple-cache", @@ -2415,16 +2415,16 @@ }, { "name": "spomky-labs/cbor-php", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/Spomky-Labs/cbor-php.git", - "reference": "658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b" + "reference": "499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/cbor-php/zipball/658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b", - "reference": "658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b", + "url": "https://api.github.com/repos/Spomky-Labs/cbor-php/zipball/499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4", + "reference": "499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4", "shasum": "" }, "require": { @@ -2435,7 +2435,7 @@ "require-dev": { "ekino/phpstan-banned-code": "^1.0", "ext-json": "*", - "infection/infection": "^0.27", + "infection/infection": "^0.29", "php-parallel-lint/php-parallel-lint": "^1.3", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", @@ -2443,9 +2443,9 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^10.1", - "qossmic/deptrac-shim": "^1.0", - "rector/rector": "^0.19", + "phpunit/phpunit": "^10.1|^11.0", + "qossmic/deptrac": "^2.0", + "rector/rector": "^1.0", "roave/security-advisories": "dev-latest", "symfony/var-dumper": "^6.0|^7.0", "symplify/easy-coding-standard": "^12.0" @@ -2482,7 +2482,7 @@ ], "support": { "issues": "https://github.com/Spomky-Labs/cbor-php/issues", - "source": "https://github.com/Spomky-Labs/cbor-php/tree/3.0.4" + "source": "https://github.com/Spomky-Labs/cbor-php/tree/3.1.0" }, "funding": [ { @@ -2494,7 +2494,7 @@ "type": "patreon" } ], - "time": "2024-01-29T20:33:48+00:00" + "time": "2024-07-18T08:37:03+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2565,16 +2565,16 @@ }, { "name": "symfony/http-client", - "version": "v6.4.8", + "version": "v6.4.11", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05" + "reference": "4c92046bb788648ff1098cc66da69aa7eac8cb65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05", - "reference": "61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05", + "url": "https://api.github.com/repos/symfony/http-client/zipball/4c92046bb788648ff1098cc66da69aa7eac8cb65", + "reference": "4c92046bb788648ff1098cc66da69aa7eac8cb65", "shasum": "" }, "require": { @@ -2638,7 +2638,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.8" + "source": "https://github.com/symfony/http-client/tree/v6.4.11" }, "funding": [ { @@ -2654,7 +2654,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-08-26T06:30:21+00:00" }, { "name": "symfony/http-client-contracts", @@ -2736,16 +2736,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947" + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27de8cc95e11db7a50b027e71caaab9024545947", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/117f1f20a7ade7bcea28b861fb79160a21a1e37b", + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b", "shasum": "" }, "require": { @@ -2793,7 +2793,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.8" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.10" }, "funding": [ { @@ -2809,20 +2809,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-26T12:36:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -2873,7 +2873,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -2889,20 +2889,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -2953,7 +2953,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -2969,25 +2969,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-php80": "^1.14" + "php": ">=7.1" }, "type": "library", "extra": { @@ -3030,7 +3029,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0" }, "funding": [ { @@ -3046,20 +3045,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:35:24+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853" + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/3abdd21b0ceaa3000ee950097bc3cf9efc137853", - "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/2ba1f33797470debcda07fe9dce20a0003df18e9", + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9", "shasum": "" }, "require": { @@ -3109,7 +3108,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.30.0" }, "funding": [ { @@ -3125,20 +3124,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v6.4.8", + "version": "v6.4.11", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "23a162bd446b93948a2c2f6909d80ad06195be10" + "reference": "74835ba54eca99a38f374f7a6d932fa510124773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/23a162bd446b93948a2c2f6909d80ad06195be10", - "reference": "23a162bd446b93948a2c2f6909d80ad06195be10", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/74835ba54eca99a38f374f7a6d932fa510124773", + "reference": "74835ba54eca99a38f374f7a6d932fa510124773", "shasum": "" }, "require": { @@ -3192,7 +3191,7 @@ "psr-7" ], "support": { - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v6.4.8" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v6.4.11" }, "funding": [ { @@ -3208,7 +3207,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:51:39+00:00" + "time": "2024-08-14T13:55:58+00:00" }, { "name": "symfony/service-contracts", @@ -3295,16 +3294,16 @@ }, { "name": "symfony/translation", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a" + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a002933b13989fc4bd0b58e04bf7eec5210e438a", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a", + "url": "https://api.github.com/repos/symfony/translation/zipball/94041203f8ac200ae9e7c6a18fa6137814ccecc9", + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9", "shasum": "" }, "require": { @@ -3370,7 +3369,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.8" + "source": "https://github.com/symfony/translation/tree/v6.4.10" }, "funding": [ { @@ -3386,7 +3385,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/translation-contracts", @@ -3468,16 +3467,16 @@ }, { "name": "symfony/uid", - "version": "v6.4.8", + "version": "v6.4.11", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf" + "reference": "6a0394ad707de386547223948fac1e0f2805bc0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", - "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", + "url": "https://api.github.com/repos/symfony/uid/zipball/6a0394ad707de386547223948fac1e0f2805bc0b", + "reference": "6a0394ad707de386547223948fac1e0f2805bc0b", "shasum": "" }, "require": { @@ -3522,7 +3521,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.4.8" + "source": "https://github.com/symfony/uid/tree/v6.4.11" }, "funding": [ { @@ -3538,7 +3537,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-08-12T09:55:28+00:00" }, { "name": "thecodingmachine/safe", @@ -3903,6 +3902,7 @@ "type": "patreon" } ], + "abandoned": "web-auth/webauthn-lib", "time": "2022-06-22T11:14:44+00:00" }, { diff --git a/lam/lib/3rdParty/composer/composer/autoload_files.php b/lam/lib/3rdParty/composer/composer/autoload_files.php index 9b1ebff93..87e5ecd7a 100644 --- a/lam/lib/3rdParty/composer/composer/autoload_files.php +++ b/lam/lib/3rdParty/composer/composer/autoload_files.php @@ -8,8 +8,8 @@ return array( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php', '662a729f963d39afe703c9d9b7ab4a8c' => $vendorDir . '/symfony/polyfill-php83/bootstrap.php', diff --git a/lam/lib/3rdParty/composer/composer/autoload_psr4.php b/lam/lib/3rdParty/composer/composer/autoload_psr4.php index b19984ddc..382acca56 100644 --- a/lam/lib/3rdParty/composer/composer/autoload_psr4.php +++ b/lam/lib/3rdParty/composer/composer/autoload_psr4.php @@ -26,7 +26,7 @@ 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), diff --git a/lam/lib/3rdParty/composer/composer/autoload_static.php b/lam/lib/3rdParty/composer/composer/autoload_static.php index 5c7d66475..d8289a723 100644 --- a/lam/lib/3rdParty/composer/composer/autoload_static.php +++ b/lam/lib/3rdParty/composer/composer/autoload_static.php @@ -9,8 +9,8 @@ class ComposerStaticInited73ceb9c1bdec18b7c6d09764d1bce5 public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php', '662a729f963d39afe703c9d9b7ab4a8c' => __DIR__ . '/..' . '/symfony/polyfill-php83/bootstrap.php', @@ -305,8 +305,8 @@ class ComposerStaticInited73ceb9c1bdec18b7c6d09764d1bce5 ), 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - 1 => __DIR__ . '/..' . '/psr/http-factory/src', + 0 => __DIR__ . '/..' . '/psr/http-factory/src', + 1 => __DIR__ . '/..' . '/psr/http-message/src', ), 'Psr\\Http\\Client\\' => array ( diff --git a/lam/lib/3rdParty/composer/composer/installed.json b/lam/lib/3rdParty/composer/composer/installed.json index c0e588bc0..75e4c1e30 100644 --- a/lam/lib/3rdParty/composer/composer/installed.json +++ b/lam/lib/3rdParty/composer/composer/installed.json @@ -750,17 +750,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", - "version_normalized": "2.6.2.0", + "version": "2.7.0", + "version_normalized": "2.7.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -775,13 +775,13 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2023-12-03T20:05:35+00:00", + "time": "2024-07-18T11:15:46+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -849,7 +849,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -930,17 +930,17 @@ }, { "name": "illuminate/collections", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "f9589f1063a449111dcaa1d68285b507d9483a95" + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/f9589f1063a449111dcaa1d68285b507d9483a95", - "reference": "f9589f1063a449111dcaa1d68285b507d9483a95", + "url": "https://api.github.com/repos/illuminate/collections/zipball/37c863cffb345869dd134eff8e646bc82a19cc96", + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96", "shasum": "" }, "require": { @@ -952,7 +952,7 @@ "suggest": { "symfony/var-dumper": "Required to use the dump method (^6.2)." }, - "time": "2024-03-20T20:09:13+00:00", + "time": "2024-06-19T14:25:05+00:00", "type": "library", "extra": { "branch-alias": { @@ -988,8 +988,8 @@ }, { "name": "illuminate/conditionable", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -1037,8 +1037,8 @@ }, { "name": "illuminate/contracts", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1088,8 +1088,8 @@ }, { "name": "illuminate/macroable", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1137,8 +1137,8 @@ }, { "name": "illuminate/pagination", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -1190,17 +1190,17 @@ }, { "name": "illuminate/support", - "version": "v10.48.12", - "version_normalized": "10.48.12.0", + "version": "v10.48.20", + "version_normalized": "10.48.20.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "263f389d81488c237846b69469f91387ca2729f3" + "reference": "56c6d9895605b019e3debb9440454596ef99312a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/263f389d81488c237846b69469f91387ca2729f3", - "reference": "263f389d81488c237846b69469f91387ca2729f3", + "url": "https://api.github.com/repos/illuminate/support/zipball/56c6d9895605b019e3debb9440454596ef99312a", + "reference": "56c6d9895605b019e3debb9440454596ef99312a", "shasum": "" }, "require": { @@ -1228,7 +1228,7 @@ "symfony/var-dumper": "Required to use the dd function (^6.2).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, - "time": "2024-05-16T21:33:51+00:00", + "time": "2024-05-20T13:31:33+00:00", "type": "library", "extra": { "branch-alias": { @@ -1264,17 +1264,17 @@ }, { "name": "monolog/monolog", - "version": "3.6.0", - "version_normalized": "3.6.0.0", + "version": "3.7.0", + "version_normalized": "3.7.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654" + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", - "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8", + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8", "shasum": "" }, "require": { @@ -1319,7 +1319,7 @@ "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2024-04-12T21:02:21+00:00", + "time": "2024-06-28T09:40:51+00:00", "type": "library", "extra": { "branch-alias": { @@ -1352,7 +1352,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.6.0" + "source": "https://github.com/Seldaek/monolog/tree/3.7.0" }, "funding": [ { @@ -1771,21 +1771,21 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.37", - "version_normalized": "3.0.37.0", + "version": "3.0.41", + "version_normalized": "3.0.41.0", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8" + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8", - "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/621c73f7dcb310b61de34d1da4c4204e8ace6ceb", + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "^1|^2", + "paragonie/constant_time_encoding": "^1|^2|^3", "paragonie/random_compat": "^1.4|^2.0|^9.99.99", "php": ">=5.6.1" }, @@ -1799,7 +1799,7 @@ "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." }, - "time": "2024-03-03T02:14:58+00:00", + "time": "2024-08-12T00:13:54+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1864,7 +1864,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.37" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.41" }, "funding": [ { @@ -2279,23 +2279,23 @@ }, { "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.0.1", + "version_normalized": "3.0.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "79dff0b268932c640297f5208d6298f71855c03e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e", + "reference": "79dff0b268932c640297f5208d6298f71855c03e", "shasum": "" }, "require": { "php": ">=8.0.0" }, - "time": "2021-07-14T16:46:02+00:00", + "time": "2024-08-21T13:31:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -2326,7 +2326,7 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.1" }, "install-path": "../psr/log" }, @@ -2480,17 +2480,17 @@ }, { "name": "spomky-labs/cbor-php", - "version": "3.0.4", - "version_normalized": "3.0.4.0", + "version": "3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https://github.com/Spomky-Labs/cbor-php.git", - "reference": "658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b" + "reference": "499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/cbor-php/zipball/658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b", - "reference": "658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b", + "url": "https://api.github.com/repos/Spomky-Labs/cbor-php/zipball/499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4", + "reference": "499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4", "shasum": "" }, "require": { @@ -2501,7 +2501,7 @@ "require-dev": { "ekino/phpstan-banned-code": "^1.0", "ext-json": "*", - "infection/infection": "^0.27", + "infection/infection": "^0.29", "php-parallel-lint/php-parallel-lint": "^1.3", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", @@ -2509,9 +2509,9 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^10.1", - "qossmic/deptrac-shim": "^1.0", - "rector/rector": "^0.19", + "phpunit/phpunit": "^10.1|^11.0", + "qossmic/deptrac": "^2.0", + "rector/rector": "^1.0", "roave/security-advisories": "dev-latest", "symfony/var-dumper": "^6.0|^7.0", "symplify/easy-coding-standard": "^12.0" @@ -2520,7 +2520,7 @@ "ext-bcmath": "GMP or BCMath extensions will drastically improve the library performance. BCMath extension needed to handle the Big Float and Decimal Fraction Tags", "ext-gmp": "GMP or BCMath extensions will drastically improve the library performance" }, - "time": "2024-01-29T20:33:48+00:00", + "time": "2024-07-18T08:37:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2550,7 +2550,7 @@ ], "support": { "issues": "https://github.com/Spomky-Labs/cbor-php/issues", - "source": "https://github.com/Spomky-Labs/cbor-php/tree/3.0.4" + "source": "https://github.com/Spomky-Labs/cbor-php/tree/3.1.0" }, "funding": [ { @@ -2636,17 +2636,17 @@ }, { "name": "symfony/http-client", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.11", + "version_normalized": "6.4.11.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05" + "reference": "4c92046bb788648ff1098cc66da69aa7eac8cb65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05", - "reference": "61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05", + "url": "https://api.github.com/repos/symfony/http-client/zipball/4c92046bb788648ff1098cc66da69aa7eac8cb65", + "reference": "4c92046bb788648ff1098cc66da69aa7eac8cb65", "shasum": "" }, "require": { @@ -2681,7 +2681,7 @@ "symfony/process": "^5.4|^6.0|^7.0", "symfony/stopwatch": "^5.4|^6.0|^7.0" }, - "time": "2024-05-31T14:49:08+00:00", + "time": "2024-08-26T06:30:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2712,7 +2712,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.8" + "source": "https://github.com/symfony/http-client/tree/v6.4.11" }, "funding": [ { @@ -2813,17 +2813,17 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.10", + "version_normalized": "6.4.10.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947" + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27de8cc95e11db7a50b027e71caaab9024545947", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/117f1f20a7ade7bcea28b861fb79160a21a1e37b", + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b", "shasum": "" }, "require": { @@ -2845,7 +2845,7 @@ "symfony/mime": "^5.4|^6.0|^7.0", "symfony/rate-limiter": "^5.4|^6.0|^7.0" }, - "time": "2024-05-31T14:49:08+00:00", + "time": "2024-07-26T12:36:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2873,7 +2873,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.8" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.10" }, "funding": [ { @@ -2893,17 +2893,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -2915,7 +2915,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-06-19T12:30:46+00:00", "type": "library", "extra": { "thanks": { @@ -2956,7 +2956,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -2976,23 +2976,23 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-05-31T15:07:36+00:00", "type": "library", "extra": { "thanks": { @@ -3039,7 +3039,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -3059,24 +3059,23 @@ }, { "name": "symfony/polyfill-php83", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-php80": "^1.14" + "php": ">=7.1" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-06-19T12:35:24+00:00", "type": "library", "extra": { "thanks": { @@ -3119,7 +3118,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0" }, "funding": [ { @@ -3139,17 +3138,17 @@ }, { "name": "symfony/polyfill-uuid", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853" + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/3abdd21b0ceaa3000ee950097bc3cf9efc137853", - "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/2ba1f33797470debcda07fe9dce20a0003df18e9", + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9", "shasum": "" }, "require": { @@ -3161,7 +3160,7 @@ "suggest": { "ext-uuid": "For best performance" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-05-31T15:07:36+00:00", "type": "library", "extra": { "thanks": { @@ -3201,7 +3200,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.30.0" }, "funding": [ { @@ -3221,17 +3220,17 @@ }, { "name": "symfony/psr-http-message-bridge", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.11", + "version_normalized": "6.4.11.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "23a162bd446b93948a2c2f6909d80ad06195be10" + "reference": "74835ba54eca99a38f374f7a6d932fa510124773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/23a162bd446b93948a2c2f6909d80ad06195be10", - "reference": "23a162bd446b93948a2c2f6909d80ad06195be10", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/74835ba54eca99a38f374f7a6d932fa510124773", + "reference": "74835ba54eca99a38f374f7a6d932fa510124773", "shasum": "" }, "require": { @@ -3253,7 +3252,7 @@ "symfony/framework-bundle": "^6.2|^7.0", "symfony/http-kernel": "^6.2|^7.0" }, - "time": "2024-05-31T14:51:39+00:00", + "time": "2024-08-14T13:55:58+00:00", "type": "symfony-bridge", "installation-source": "dist", "autoload": { @@ -3287,7 +3286,7 @@ "psr-7" ], "support": { - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v6.4.8" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v6.4.11" }, "funding": [ { @@ -3393,17 +3392,17 @@ }, { "name": "symfony/translation", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.10", + "version_normalized": "6.4.10.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a" + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a002933b13989fc4bd0b58e04bf7eec5210e438a", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a", + "url": "https://api.github.com/repos/symfony/translation/zipball/94041203f8ac200ae9e7c6a18fa6137814ccecc9", + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9", "shasum": "" }, "require": { @@ -3440,7 +3439,7 @@ "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^5.4|^6.0|^7.0" }, - "time": "2024-05-31T14:49:08+00:00", + "time": "2024-07-26T12:30:32+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3471,7 +3470,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.8" + "source": "https://github.com/symfony/translation/tree/v6.4.10" }, "funding": [ { @@ -3572,17 +3571,17 @@ }, { "name": "symfony/uid", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.11", + "version_normalized": "6.4.11.0", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf" + "reference": "6a0394ad707de386547223948fac1e0f2805bc0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", - "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", + "url": "https://api.github.com/repos/symfony/uid/zipball/6a0394ad707de386547223948fac1e0f2805bc0b", + "reference": "6a0394ad707de386547223948fac1e0f2805bc0b", "shasum": "" }, "require": { @@ -3592,7 +3591,7 @@ "require-dev": { "symfony/console": "^5.4|^6.0|^7.0" }, - "time": "2024-05-31T14:49:08+00:00", + "time": "2024-08-12T09:55:28+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3629,7 +3628,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.4.8" + "source": "https://github.com/symfony/uid/tree/v6.4.11" }, "funding": [ { diff --git a/lam/lib/3rdParty/composer/composer/installed.php b/lam/lib/3rdParty/composer/composer/installed.php index 135ff9018..734b195bb 100644 --- a/lam/lib/3rdParty/composer/composer/installed.php +++ b/lam/lib/3rdParty/composer/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'ldap-account-manager/ldap-account-manager', - 'pretty_version' => '8.7', - 'version' => '8.7.0.0', + 'pretty_version' => '8.8', + 'version' => '8.8.0.0', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../../../', @@ -101,9 +101,9 @@ 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.6.2', - 'version' => '2.6.2.0', - 'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221', + 'pretty_version' => '2.7.0', + 'version' => '2.7.0.0', + 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), @@ -119,17 +119,17 @@ 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', - 'reference' => 'f9589f1063a449111dcaa1d68285b507d9483a95', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', + 'reference' => '37c863cffb345869dd134eff8e646bc82a19cc96', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/conditionable' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', 'reference' => 'd0958e4741fc9d6f516a552060fd1b829a85e009', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/conditionable', @@ -137,8 +137,8 @@ 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', @@ -146,8 +146,8 @@ 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', 'reference' => 'dff667a46ac37b634dcf68909d9d41e94dc97c27', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', @@ -155,8 +155,8 @@ 'dev_requirement' => false, ), 'illuminate/pagination' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', 'reference' => '616874b9607ff35925347e1710a8b5151858cdf2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', @@ -164,17 +164,17 @@ 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v10.48.12', - 'version' => '10.48.12.0', - 'reference' => '263f389d81488c237846b69469f91387ca2729f3', + 'pretty_version' => 'v10.48.20', + 'version' => '10.48.20.0', + 'reference' => '56c6d9895605b019e3debb9440454596ef99312a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), 'dev_requirement' => false, ), 'ldap-account-manager/ldap-account-manager' => array( - 'pretty_version' => '8.7', - 'version' => '8.7.0.0', + 'pretty_version' => '8.8', + 'version' => '8.8.0.0', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../../../', @@ -182,9 +182,9 @@ 'dev_requirement' => false, ), 'monolog/monolog' => array( - 'pretty_version' => '3.6.0', - 'version' => '3.6.0.0', - 'reference' => '4b18b21a5527a3d5ffdac2fd35d3ab25a9597654', + 'pretty_version' => '3.7.0', + 'version' => '3.7.0.0', + 'reference' => 'f4393b648b78a5408747de94fca38beb5f7e9ef8', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), @@ -248,9 +248,9 @@ 'dev_requirement' => false, ), 'phpseclib/phpseclib' => array( - 'pretty_version' => '3.0.37', - 'version' => '3.0.37.0', - 'reference' => 'cfa2013d0f68c062055180dd4328cc8b9d1f30b8', + 'pretty_version' => '3.0.41', + 'version' => '3.0.41.0', + 'reference' => '621c73f7dcb310b61de34d1da4c4204e8ace6ceb', 'type' => 'library', 'install_path' => __DIR__ . '/../phpseclib/phpseclib', 'aliases' => array(), @@ -308,9 +308,9 @@ 'psr/http-factory-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0', - 1 => '^1.0', - 2 => '*', + 0 => '^1.0', + 1 => '*', + 2 => '1.0', ), ), 'psr/http-message' => array( @@ -325,8 +325,8 @@ 'psr/http-message-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0', - 1 => '*', + 0 => '*', + 1 => '1.0', ), ), 'psr/http-server-handler' => array( @@ -348,9 +348,9 @@ 'dev_requirement' => false, ), 'psr/log' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', + 'pretty_version' => '3.0.1', + 'version' => '3.0.1.0', + 'reference' => '79dff0b268932c640297f5208d6298f71855c03e', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), @@ -390,9 +390,9 @@ 'dev_requirement' => false, ), 'spomky-labs/cbor-php' => array( - 'pretty_version' => '3.0.4', - 'version' => '3.0.4.0', - 'reference' => '658ed12a85a6b31fa312b89cd92f3a4ce6df4c6b', + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'reference' => '499d9bff0a6d59c4f1b813cc617fc3fd56d6dca4', 'type' => 'library', 'install_path' => __DIR__ . '/../spomky-labs/cbor-php', 'aliases' => array(), @@ -408,9 +408,9 @@ 'dev_requirement' => false, ), 'symfony/http-client' => array( - 'pretty_version' => 'v6.4.8', - 'version' => '6.4.8.0', - 'reference' => '61faba993e620fc22d4f0ab3b6bcf8fbb0d44b05', + 'pretty_version' => 'v6.4.11', + 'version' => '6.4.11.0', + 'reference' => '4c92046bb788648ff1098cc66da69aa7eac8cb65', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-client', 'aliases' => array(), @@ -432,54 +432,54 @@ ), ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v6.4.8', - 'version' => '6.4.8.0', - 'reference' => '27de8cc95e11db7a50b027e71caaab9024545947', + 'pretty_version' => 'v6.4.10', + 'version' => '6.4.10.0', + 'reference' => '117f1f20a7ade7bcea28b861fb79160a21a1e37b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b', + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php83' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '86fcae159633351e5fd145d1c47de6c528f8caff', + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php83', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-uuid' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '3abdd21b0ceaa3000ee950097bc3cf9efc137853', + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => '2ba1f33797470debcda07fe9dce20a0003df18e9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-uuid', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/psr-http-message-bridge' => array( - 'pretty_version' => 'v6.4.8', - 'version' => '6.4.8.0', - 'reference' => '23a162bd446b93948a2c2f6909d80ad06195be10', + 'pretty_version' => 'v6.4.11', + 'version' => '6.4.11.0', + 'reference' => '74835ba54eca99a38f374f7a6d932fa510124773', 'type' => 'symfony-bridge', 'install_path' => __DIR__ . '/../symfony/psr-http-message-bridge', 'aliases' => array(), @@ -495,9 +495,9 @@ 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v6.4.8', - 'version' => '6.4.8.0', - 'reference' => 'a002933b13989fc4bd0b58e04bf7eec5210e438a', + 'pretty_version' => 'v6.4.10', + 'version' => '6.4.10.0', + 'reference' => '94041203f8ac200ae9e7c6a18fa6137814ccecc9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), @@ -519,9 +519,9 @@ ), ), 'symfony/uid' => array( - 'pretty_version' => 'v6.4.8', - 'version' => '6.4.8.0', - 'reference' => '35904eca37a84bb764c560cbfcac9f0ac2bcdbdf', + 'pretty_version' => 'v6.4.11', + 'version' => '6.4.11.0', + 'reference' => '6a0394ad707de386547223948fac1e0f2805bc0b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/uid', 'aliases' => array(), diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/CHANGELOG.md b/lam/lib/3rdParty/composer/guzzlehttp/psr7/CHANGELOG.md index fe3eda70a..75aabfb93 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/CHANGELOG.md +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/CHANGELOG.md @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.7.0 - 2024-07-18 + +### Added + +- Add `Utils::redactUserInfo()` method +- Add ability to encode bools as ints in `Query::build` + +## 2.6.3 - 2024-07-18 + +### Fixed + +- Make `StreamWrapper::stream_stat()` return `false` if inner stream's size is `null` + +### Changed + +- PHP 8.4 support + ## 2.6.2 - 2023-12-03 ### Fixed diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/README.md b/lam/lib/3rdParty/composer/guzzlehttp/psr7/README.md index 850fa9d70..2e9bb0b9b 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/README.md +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/README.md @@ -24,8 +24,8 @@ composer require guzzlehttp/psr7 | Version | Status | PHP Version | |---------|---------------------|--------------| -| 1.x | Security fixes only | >=5.4,<8.1 | -| 2.x | Latest | >=7.2.5,<8.4 | +| 1.x | EOL (2024-06-30) | >=5.4,<8.2 | +| 2.x | Latest | >=7.2.5,<8.5 | ## AppendStream @@ -436,7 +436,7 @@ will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. ## `GuzzleHttp\Psr7\Query::build` -`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string` Build a query string from an array of key value pairs. @@ -498,11 +498,18 @@ a message. ## `GuzzleHttp\Psr7\Utils::readLine` -`public static function readLine(StreamInterface $stream, int $maxLength = null): string` +`public static function readLine(StreamInterface $stream, ?int $maxLength = null): string` Read a line from the stream up to the maximum allowed buffer length. +## `GuzzleHttp\Psr7\Utils::redactUserInfo` + +`public static function redactUserInfo(UriInterface $uri): UriInterface` + +Redact the password in the user info part of a URI. + + ## `GuzzleHttp\Psr7\Utils::streamFor` `public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` @@ -674,7 +681,7 @@ termed a relative-path reference. ### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` -`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` +`public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool` Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its fragment component, identical to the base URI. When no base URI is given, only an empty URI reference diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/composer.json b/lam/lib/3rdParty/composer/guzzlehttp/psr7/composer.json index 70293fc40..28d15f571 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/composer.json +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/composer.json @@ -61,8 +61,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/CachingStream.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/CachingStream.php index f34722cff..7e4554d5c 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/CachingStream.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/CachingStream.php @@ -33,7 +33,7 @@ final class CachingStream implements StreamInterface */ public function __construct( StreamInterface $stream, - StreamInterface $target = null + ?StreamInterface $target = null ) { $this->remoteStream = $stream; $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/HttpFactory.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/HttpFactory.php index 73d17e337..3ef15103a 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/HttpFactory.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/HttpFactory.php @@ -27,10 +27,10 @@ final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInter { public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = \UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface { if ($size === null) { $size = $stream->getSize(); diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/MultipartStream.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/MultipartStream.php index d23fba8a3..43d718f65 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/MultipartStream.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/MultipartStream.php @@ -32,7 +32,7 @@ final class MultipartStream implements StreamInterface * * @throws \InvalidArgumentException */ - public function __construct(array $elements = [], string $boundary = null) + public function __construct(array $elements = [], ?string $boundary = null) { $this->boundary = $boundary ?: bin2hex(random_bytes(20)); $this->stream = $this->createStream($elements); diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Query.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Query.php index 8b9492797..ccf867a0b 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Query.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Query.php @@ -63,12 +63,15 @@ public static function parse(string $str, $urlEncoding = true): array * string. This function does not modify the provided keys when an array is * encountered (like `http_build_query()` would). * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, + * PHP_QUERY_RFC3986 to encode using + * RFC3986, or PHP_QUERY_RFC1738 to + * encode using RFC1738. + * @param bool $treatBoolsAsInts Set to true to encode as 0/1, and + * false as false/true. */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string + public static function build(array $params, $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string { if (!$params) { return ''; @@ -86,12 +89,14 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri throw new \InvalidArgumentException('Invalid type'); } + $castBool = $treatBoolsAsInts ? static function ($v) { return (int) $v; } : static function ($v) { return $v ? 'true' : 'false'; }; + $qs = ''; foreach ($params as $k => $v) { $k = $encoder((string) $k); if (!is_array($v)) { $qs .= $k; - $v = is_bool($v) ? (int) $v : $v; + $v = is_bool($v) ? $castBool($v) : $v; if ($v !== null) { $qs .= '='.$encoder((string) $v); } @@ -99,7 +104,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri } else { foreach ($v as $vv) { $qs .= $k; - $vv = is_bool($vv) ? (int) $vv : $vv; + $vv = is_bool($vv) ? $castBool($vv) : $vv; if ($vv !== null) { $qs .= '='.$encoder((string) $vv); } diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Response.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Response.php index 00f16e2d9..34e612fda 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Response.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Response.php @@ -96,7 +96,7 @@ public function __construct( array $headers = [], $body = null, string $version = '1.1', - string $reason = null + ?string $reason = null ) { $this->assertStatusCodeRange($status); diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/StreamWrapper.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/StreamWrapper.php index ae8538814..77b04d747 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/StreamWrapper.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/StreamWrapper.php @@ -69,7 +69,7 @@ public static function register(): void } } - public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool + public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null): bool { $options = stream_context_get_options($this->context); @@ -136,10 +136,14 @@ public function stream_cast(int $cast_as) * ctime: int, * blksize: int, * blocks: int - * } + * }|false */ - public function stream_stat(): array + public function stream_stat() { + if ($this->stream->getSize() === null) { + return false; + } + static $modeMap = [ 'r' => 33060, 'rb' => 33060, diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/UploadedFile.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/UploadedFile.php index b26719937..9c9ea49fb 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/UploadedFile.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/UploadedFile.php @@ -64,8 +64,8 @@ public function __construct( $streamOrFile, ?int $size, int $errorStatus, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ) { $this->setError($errorStatus); $this->size = $size; diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Uri.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Uri.php index f1feee871..481dfca94 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Uri.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Uri.php @@ -279,7 +279,7 @@ public static function isRelativePathReference(UriInterface $uri): bool * * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4 */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool + public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool { if ($base !== null) { $uri = UriResolver::resolve($base, $uri); diff --git a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Utils.php b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Utils.php index bf5ea9dba..7682d2cdc 100644 --- a/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Utils.php +++ b/lam/lib/3rdParty/composer/guzzlehttp/psr7/src/Utils.php @@ -231,7 +231,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length */ - public static function readLine(StreamInterface $stream, int $maxLength = null): string + public static function readLine(StreamInterface $stream, ?int $maxLength = null): string { $buffer = ''; $size = 0; @@ -250,6 +250,20 @@ public static function readLine(StreamInterface $stream, int $maxLength = null): return $buffer; } + /** + * Redact the password in the user info part of a URI. + */ + public static function redactUserInfo(UriInterface $uri): UriInterface + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = \strpos($userInfo, ':'))) { + return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + /** * Create a new stream based on the input type. * diff --git a/lam/lib/3rdParty/composer/illuminate/collections/Collection.php b/lam/lib/3rdParty/composer/illuminate/collections/Collection.php index c46fc052f..d7369d686 100644 --- a/lam/lib/3rdParty/composer/illuminate/collections/Collection.php +++ b/lam/lib/3rdParty/composer/illuminate/collections/Collection.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; +use InvalidArgumentException; use stdClass; use Traversable; @@ -1124,17 +1125,27 @@ public function search($value, $strict = false) * * @param int $count * @return static|TValue|null + * + * @throws \InvalidArgumentException */ public function shift($count = 1) { - if ($count === 1) { - return array_shift($this->items); + if ($count < 0) { + throw new InvalidArgumentException('Number of shifted items may not be less than zero.'); } if ($this->isEmpty()) { + return null; + } + + if ($count === 0) { return new static; } + if ($count === 1) { + return array_shift($this->items); + } + $results = []; $collectionCount = $this->count(); diff --git a/lam/lib/3rdParty/composer/illuminate/support/ValidatedInput.php b/lam/lib/3rdParty/composer/illuminate/support/ValidatedInput.php index 87e47b552..70bc6c3d2 100644 --- a/lam/lib/3rdParty/composer/illuminate/support/ValidatedInput.php +++ b/lam/lib/3rdParty/composer/illuminate/support/ValidatedInput.php @@ -4,7 +4,9 @@ use ArrayIterator; use Illuminate\Contracts\Support\ValidatedData; +use Illuminate\Support\Facades\Date; use stdClass; +use Symfony\Component\VarDumper\VarDumper; use Traversable; class ValidatedInput implements ValidatedData @@ -38,7 +40,7 @@ public function has($keys) $keys = is_array($keys) ? $keys : func_get_args(); foreach ($keys as $key) { - if (! Arr::has($this->input, $key)) { + if (! Arr::has($this->all(), $key)) { return false; } } @@ -67,7 +69,7 @@ public function only($keys) { $results = []; - $input = $this->input; + $input = $this->all(); $placeholder = new stdClass; @@ -92,7 +94,7 @@ public function except($keys) { $keys = is_array($keys) ? $keys : func_get_args(); - $results = $this->input; + $results = $this->all(); Arr::forget($results, $keys); @@ -107,17 +109,18 @@ public function except($keys) */ public function merge(array $items) { - return new static(array_merge($this->input, $items)); + return new static(array_merge($this->all(), $items)); } /** * Get the input as a collection. * + * @param array|string|null $key * @return \Illuminate\Support\Collection */ - public function collect() + public function collect($key = null) { - return new Collection($this->input); + return collect(is_array($key) ? $this->only($key) : $this->input($key)); } /** @@ -148,7 +151,7 @@ public function toArray() */ public function __get($name) { - return $this->input[$name]; + return $this->input($name); } /** @@ -170,7 +173,7 @@ public function __set($name, $value) */ public function __isset($name) { - return isset($this->input[$name]); + return $this->exists($name); } /** @@ -192,7 +195,7 @@ public function __unset($name) */ public function offsetExists($key): bool { - return isset($this->input[$key]); + return $this->exists($key); } /** @@ -203,7 +206,7 @@ public function offsetExists($key): bool */ public function offsetGet($key): mixed { - return $this->input[$key]; + return $this->input($key); } /** @@ -242,4 +245,320 @@ public function getIterator(): Traversable { return new ArrayIterator($this->input); } + + /** + * Determine if the validated inputs contains a given input item key. + * + * @param string|array $key + * @return bool + */ + public function exists($key) + { + return $this->has($key); + } + + /** + * Determine if the validated inputs contains any of the given inputs. + * + * @param string|array $keys + * @return bool + */ + public function hasAny($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + $input = $this->all(); + + return Arr::hasAny($input, $keys); + } + + /** + * Apply the callback if the validated inputs contains the given input item key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenHas($key, callable $callback, callable $default = null) + { + if ($this->has($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Determine if the validated inputs contains a non-empty value for an input item. + * + * @param string|array $key + * @return bool + */ + public function filled($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->isEmptyString($value)) { + return false; + } + } + + return true; + } + + /** + * Determine if the validated inputs contains an empty value for an input item. + * + * @param string|array $key + * @return bool + */ + public function isNotFilled($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if (! $this->isEmptyString($value)) { + return false; + } + } + + return true; + } + + /** + * Determine if the validated inputs contains a non-empty value for any of the given inputs. + * + * @param string|array $keys + * @return bool + */ + public function anyFilled($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + foreach ($keys as $key) { + if ($this->filled($key)) { + return true; + } + } + + return false; + } + + /** + * Apply the callback if the validated inputs contains a non-empty value for the given input item key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenFilled($key, callable $callback, callable $default = null) + { + if ($this->filled($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Apply the callback if the validated inputs is missing the given input item key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenMissing($key, callable $callback, callable $default = null) + { + if ($this->missing($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Determine if the given input key is an empty string for "filled". + * + * @param string $key + * @return bool + */ + protected function isEmptyString($key) + { + $value = $this->input($key); + + return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; + } + + /** + * Get the keys for all of the input. + * + * @return array + */ + public function keys() + { + return array_keys($this->input()); + } + + /** + * Retrieve an input item from the validated inputs. + * + * @param string|null $key + * @param mixed $default + * @return mixed + */ + public function input($key = null, $default = null) + { + return data_get( + $this->all(), $key, $default + ); + } + + /** + * Retrieve input from the validated inputs as a Stringable instance. + * + * @param string $key + * @param mixed $default + * @return \Illuminate\Support\Stringable + */ + public function str($key, $default = null) + { + return $this->string($key, $default); + } + + /** + * Retrieve input from the validated inputs as a Stringable instance. + * + * @param string $key + * @param mixed $default + * @return \Illuminate\Support\Stringable + */ + public function string($key, $default = null) + { + return str($this->input($key, $default)); + } + + /** + * Retrieve input as a boolean value. + * + * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. + * + * @param string|null $key + * @param bool $default + * @return bool + */ + public function boolean($key = null, $default = false) + { + return filter_var($this->input($key, $default), FILTER_VALIDATE_BOOLEAN); + } + + /** + * Retrieve input as an integer value. + * + * @param string $key + * @param int $default + * @return int + */ + public function integer($key, $default = 0) + { + return intval($this->input($key, $default)); + } + + /** + * Retrieve input as a float value. + * + * @param string $key + * @param float $default + * @return float + */ + public function float($key, $default = 0.0) + { + return floatval($this->input($key, $default)); + } + + /** + * Retrieve input from the validated inputs as a Carbon instance. + * + * @param string $key + * @param string|null $format + * @param string|null $tz + * @return \Illuminate\Support\Carbon|null + * + * @throws \Carbon\Exceptions\InvalidFormatException + */ + public function date($key, $format = null, $tz = null) + { + if ($this->isNotFilled($key)) { + return null; + } + + if (is_null($format)) { + return Date::parse($this->input($key), $tz); + } + + return Date::createFromFormat($format, $this->input($key), $tz); + } + + /** + * Retrieve input from the validated inputs as an enum. + * + * @template TEnum + * + * @param string $key + * @param class-string $enumClass + * @return TEnum|null + */ + public function enum($key, $enumClass) + { + if ($this->isNotFilled($key) || + ! enum_exists($enumClass) || + ! method_exists($enumClass, 'tryFrom')) { + return null; + } + + return $enumClass::tryFrom($this->input($key)); + } + + /** + * Dump the validated inputs items and end the script. + * + * @param mixed ...$keys + * @return never + */ + public function dd(...$keys) + { + $this->dump(...$keys); + + exit(1); + } + + /** + * Dump the items. + * + * @param mixed $keys + * @return $this + */ + public function dump($keys = []) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all()); + + return $this; + } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/CHANGELOG.md b/lam/lib/3rdParty/composer/monolog/monolog/CHANGELOG.md index fa4dfa860..ec355568c 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/CHANGELOG.md +++ b/lam/lib/3rdParty/composer/monolog/monolog/CHANGELOG.md @@ -1,3 +1,9 @@ +### 3.7.0 (2024-06-28) + + * Added `NormalizerFormatter->setBasePath(...)` (and `JsonFormatter` by extension) that allows removing the project's path from the stack trace output (47e301d3e) + * Fixed JsonFormatter handling of incomplete classes (#1834) + * Fixed private error handlers causing problems with custom StreamHandler implementations (#1866) + ### 3.6.0 (2024-04-12) * Added `LineFormatter->setBasePath(...)` that allows removing the project's path from the stack trace output (#1873) diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/ErrorHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/ErrorHandler.php index 08d414b34..452778b88 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/ErrorHandler.php @@ -124,8 +124,8 @@ public function registerErrorHandler(array $levelMap = [], bool $callPrevious = } /** - * @param LogLevel::*|null $level a LogLevel::* constant, null to use the default LogLevel::ALERT - * @param int $reservedMemorySize Amount of KBs to reserve in memory so that it can be freed when handling fatal errors giving Monolog some room in memory to get its job done + * @param LogLevel::*|null $level a LogLevel::* constant, null to use the default LogLevel::ALERT + * @param int $reservedMemorySize Amount of KBs to reserve in memory so that it can be freed when handling fatal errors giving Monolog some room in memory to get its job done * @return $this */ public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self @@ -194,7 +194,7 @@ private function handleException(\Throwable $e): never ($this->previousExceptionHandler)($e); } - if (!headers_sent() && in_array(strtolower((string) ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { + if (!headers_sent() && \in_array(strtolower((string) \ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { http_response_code(500); } @@ -208,7 +208,7 @@ private function handleError(int $code, string $message, string $file = '', int } // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$this->hasFatalErrorHandler || !in_array($code, self::FATAL_ERRORS, true)) { + if (!$this->hasFatalErrorHandler || !\in_array($code, self::FATAL_ERRORS, true)) { $level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL; $this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]); } else { @@ -234,12 +234,12 @@ public function handleFatalError(): void { $this->reservedMemory = ''; - if (is_array($this->lastFatalData)) { + if (\is_array($this->lastFatalData)) { $lastError = $this->lastFatalData; } else { $lastError = error_get_last(); } - if (is_array($lastError) && in_array($lastError['type'], self::FATAL_ERRORS, true)) { + if (\is_array($lastError) && \in_array($lastError['type'], self::FATAL_ERRORS, true)) { $trace = $lastError['trace'] ?? null; $this->logger->log( $this->fatalLevel, diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php index 3f1d45829..beb5106af 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php @@ -59,7 +59,7 @@ public function format(LogRecord $record) if (\count($record->extra) > 0) { $message['extra'] = $record->extra; } - if (count($message) === 1) { + if (\count($message) === 1) { $message = reset($message); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php index c64da7c06..cc805c892 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php @@ -86,7 +86,7 @@ public function getShortMessage(string $message): string static $hasMbString; if (null === $hasMbString) { - $hasMbString = function_exists('mb_strlen'); + $hasMbString = \function_exists('mb_strlen'); } $maxLength = 45; @@ -96,7 +96,7 @@ public function getShortMessage(string $message): string $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...'; } } else { - if (strlen($message) > $maxLength) { + if (\strlen($message) > $maxLength) { $message = substr($message, 0, $maxLength - 4) . ' ...'; } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php index 04495a614..0c9f3e162 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php @@ -47,7 +47,7 @@ class FluentdFormatter implements FormatterInterface */ public function __construct(bool $levelTag = false) { - if (!function_exists('json_encode')) { + if (!\function_exists('json_encode')) { throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index 96cb60ffe..dd6fefbcb 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -104,7 +104,7 @@ public function format(LogRecord $record): Message ->setLevel($this->getGraylog2Priority($record->level)); // message length + system name length + 200 for padding / metadata - $len = 200 + strlen($record->message) + strlen($this->systemName); + $len = 200 + \strlen($record->message) + \strlen($this->systemName); if ($len > $this->maxLength) { $message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength)); @@ -115,8 +115,8 @@ public function format(LogRecord $record): Message } foreach ($extra as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->extraPrefix . $key . $val); + $val = \is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = \strlen($this->extraPrefix . $key . $val); if ($len > $this->maxLength) { $message->setAdditional($this->extraPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength)); @@ -126,8 +126,8 @@ public function format(LogRecord $record): Message } foreach ($context as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->contextPrefix . $key . $val); + $val = \is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = \strlen($this->contextPrefix . $key . $val); if ($len > $this->maxLength) { $message->setAdditional($this->contextPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength)); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php index c316b65ee..b5d69bcfd 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -42,7 +42,7 @@ protected function getLevelColor(Level $level): string } /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format + * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format * @throws \RuntimeException If the function json_encode does not exist */ public function __construct(?string $dateFormat = null) @@ -132,7 +132,7 @@ public function formatBatch(array $records): string */ protected function convertToString($data): string { - if (null === $data || is_scalar($data)) { + if (null === $data || \is_scalar($data)) { return (string) $data; } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index ca3d7d27f..640043a7e 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -154,13 +154,13 @@ protected function normalize(mixed $data, int $depth = 0): mixed return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization'; } - if (is_array($data)) { + if (\is_array($data)) { $normalized = []; $count = 1; foreach ($data as $key => $value) { if ($count++ > $this->maxNormalizeItemCount) { - $normalized['...'] = 'Over '.$this->maxNormalizeItemCount.' items ('.count($data).' total), aborting normalization'; + $normalized['...'] = 'Over '.$this->maxNormalizeItemCount.' items ('.\count($data).' total), aborting normalization'; break; } @@ -170,7 +170,7 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $normalized; } - if (is_object($data)) { + if (\is_object($data)) { if ($data instanceof \DateTimeInterface) { return $this->formatDate($data); } @@ -188,10 +188,14 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data->__toString(); } + if (\get_class($data) === '__PHP_Incomplete_Class') { + return new \ArrayObject($data); + } + return $data; } - if (is_resource($data)) { + if (\is_resource($data)) { return parent::normalize($data); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index 7d35960cc..ba5852b39 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -84,7 +84,7 @@ public function includeStacktraces(bool $include = true, ?Closure $parser = null /** * Indent stack traces to separate them a bit from the main log record messages * - * @param string $indent The string used to indent, for example " " + * @param string $indent The string used to indent, for example " " * @return $this */ public function indentStacktraces(string $indent): self @@ -117,7 +117,7 @@ public function ignoreEmptyContextAndExtra(bool $ignore = true): self /** * Allows cutting the level name to get fixed-length levels like INF for INFO, ERR for ERROR if you set this to 3 for example * - * @param int|null $maxLevelNameLength Maximum characters for the level name. Set null for infinite length (default) + * @param int|null $maxLevelNameLength Maximum characters for the level name. Set null for infinite length (default) * @return $this */ public function setMaxLevelNameLength(?int $maxLevelNameLength = null): self @@ -226,11 +226,11 @@ protected function normalizeException(\Throwable $e, int $depth = 0): string */ protected function convertToString($data): string { - if (null === $data || is_bool($data)) { + if (null === $data || \is_bool($data)) { return var_export($data, true); } - if (is_scalar($data)) { + if (\is_scalar($data)) { return (string) $data; } @@ -244,6 +244,7 @@ protected function replaceNewlines(string $str): string $str = preg_replace('/(?detail)) { - if (is_string($e->detail)) { + if (\is_string($e->detail)) { $str .= ' detail: ' . $e->detail; - } elseif (is_object($e->detail) || is_array($e->detail)) { + } elseif (\is_object($e->detail) || \is_array($e->detail)) { $str .= ' detail: ' . $this->toJson($e->detail, true); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php index 9b7da8a9c..2da3e0bec 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php @@ -36,7 +36,7 @@ public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsStri $this->maxNestingLevel = max($maxNestingLevel, 0); $this->exceptionTraceAsString = $exceptionTraceAsString; - $this->isLegacyMongoExt = extension_loaded('mongodb') && version_compare((string) phpversion('mongodb'), '1.1.9', '<='); + $this->isLegacyMongoExt = \extension_loaded('mongodb') && version_compare((string) phpversion('mongodb'), '1.1.9', '<='); } /** @@ -82,9 +82,9 @@ protected function formatArray(array $array, int $nestingLevel = 0) $array[$name] = $this->formatDate($value, $nestingLevel + 1); } elseif ($value instanceof \Throwable) { $array[$name] = $this->formatException($value, $nestingLevel + 1); - } elseif (is_array($value)) { + } elseif (\is_array($value)) { $array[$name] = $this->formatArray($value, $nestingLevel + 1); - } elseif (is_object($value) && !$value instanceof Type) { + } elseif (\is_object($value) && !$value instanceof Type) { $array[$name] = $this->formatObject($value, $nestingLevel + 1); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 134c6879f..e6f35be4d 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -31,14 +31,16 @@ class NormalizerFormatter implements FormatterInterface private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; + protected string $basePath = ''; + /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format + * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format * @throws \RuntimeException If the function json_encode does not exist */ public function __construct(?string $dateFormat = null) { $this->dateFormat = null === $dateFormat ? static::SIMPLE_DATE : $dateFormat; - if (!function_exists('json_encode')) { + if (!\function_exists('json_encode')) { throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter'); } } @@ -140,6 +142,21 @@ public function setJsonPrettyPrint(bool $enable): self return $this; } + /** + * Setting a base path will hide the base path from exception and stack trace file names to shorten them + * @return $this + */ + public function setBasePath(string $path = ''): self + { + if ($path !== '') { + $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + } + + $this->basePath = $path; + + return $this; + } + /** * Provided as extension point * @@ -165,8 +182,8 @@ protected function normalize(mixed $data, int $depth = 0): mixed return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; } - if (null === $data || is_scalar($data)) { - if (is_float($data)) { + if (null === $data || \is_scalar($data)) { + if (\is_float($data)) { if (is_infinite($data)) { return ($data > 0 ? '' : '-') . 'INF'; } @@ -178,13 +195,13 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data; } - if (is_array($data)) { + if (\is_array($data)) { $normalized = []; $count = 1; foreach ($data as $key => $value) { if ($count++ > $this->maxNormalizeItemCount) { - $normalized['...'] = 'Over ' . $this->maxNormalizeItemCount . ' items ('.count($data).' total), aborting normalization'; + $normalized['...'] = 'Over ' . $this->maxNormalizeItemCount . ' items ('.\count($data).' total), aborting normalization'; break; } @@ -198,7 +215,7 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $this->formatDate($data); } - if (is_object($data)) { + if (\is_object($data)) { if ($data instanceof Throwable) { return $this->normalizeException($data, $depth); } @@ -227,11 +244,11 @@ protected function normalize(mixed $data, int $depth = 0): mixed return [Utils::getClass($data) => $value]; } - if (is_resource($data)) { + if (\is_resource($data)) { return sprintf('[resource(%s)]', get_resource_type($data)); } - return '[unknown('.gettype($data).')]'; + return '[unknown('.\gettype($data).')]'; } /** @@ -247,11 +264,16 @@ protected function normalizeException(Throwable $e, int $depth = 0) return (array) $e->jsonSerialize(); } + $file = $e->getFile(); + if ($this->basePath !== '') { + $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file); + } + $data = [ 'class' => Utils::getClass($e), 'message' => $e->getMessage(), 'code' => (int) $e->getCode(), - 'file' => $e->getFile().':'.$e->getLine(), + 'file' => $file.':'.$e->getLine(), ]; if ($e instanceof \SoapFault) { @@ -264,9 +286,9 @@ protected function normalizeException(Throwable $e, int $depth = 0) } if (isset($e->detail)) { - if (is_string($e->detail)) { + if (\is_string($e->detail)) { $data['detail'] = $e->detail; - } elseif (is_object($e->detail) || is_array($e->detail)) { + } elseif (\is_object($e->detail) || \is_array($e->detail)) { $data['detail'] = $this->toJson($e->detail, true); } } @@ -275,7 +297,11 @@ protected function normalizeException(Throwable $e, int $depth = 0) $trace = $e->getTrace(); foreach ($trace as $frame) { if (isset($frame['file'], $frame['line'])) { - $data['trace'][] = $frame['file'].':'.$frame['line']; + $file = $frame['file']; + if ($this->basePath !== '') { + $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file); + } + $data['trace'][] = $file.':'.$frame['line']; } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php index 4bc20a08c..ec73a0ec4 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php @@ -40,7 +40,7 @@ protected function toScalar(mixed $value): string|int|float|bool|null { $normalized = $this->normalize($value); - if (is_array($normalized)) { + if (\is_array($normalized)) { return $this->toJson($normalized, true); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php index 6ed7e92ef..ccaddf77a 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php @@ -44,7 +44,6 @@ public function format(LogRecord $record): string } /** - * @param LogRecord $record * @return array */ private function formatExtra(LogRecord $record): array diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php index 2e28b3ab4..28a1deecf 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php @@ -73,19 +73,19 @@ public function format(LogRecord $record): string $message = ['message' => $record->message]; $handleError = false; - if (count($record->context) > 0) { + if (\count($record->context) > 0) { $message['context'] = $this->normalize($record->context); $handleError = true; } - if (count($record->extra) > 0) { + if (\count($record->extra) > 0) { $message['extra'] = $this->normalize($record->extra); $handleError = true; } - if (count($message) === 1) { + if (\count($message) === 1) { $message = reset($message); } - if (is_array($message) && isset($message['context']['table'])) { + if (\is_array($message) && isset($message['context']['table'])) { $type = 'TABLE'; $label = $record->channel .': '. $record->message; $message = $message['context']['table']; @@ -108,7 +108,7 @@ public function format(LogRecord $record): string // The message itself is a serialization of the above JSON object + it's length return sprintf( '%d|%s|', - strlen($json), + \strlen($json), $json ); } @@ -130,7 +130,7 @@ public function formatBatch(array $records) */ protected function normalize(mixed $data, int $depth = 0): mixed { - if (is_object($data) && !$data instanceof \DateTimeInterface) { + if (\is_object($data) && !$data instanceof \DateTimeInterface) { return $data; } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractHandler.php index d3c2cbd7b..61d45d58b 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractHandler.php @@ -29,7 +29,7 @@ abstract class AbstractHandler extends Handler implements ResettableInterface /** * @param int|string|Level|LogLevel::* $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ @@ -50,7 +50,7 @@ public function isHandling(LogRecord $record): bool /** * Sets minimum logging level at which this handler will be triggered. * - * @param Level|LogLevel::* $level Level or level name + * @param Level|LogLevel::* $level Level or level name * @return $this * * @phpstan-param value-of|value-of|Level|LogLevel::* $level @@ -73,8 +73,8 @@ public function getLevel(): Level /** * Sets the bubbling behavior. * - * @param bool $bubble true means that this handler allows bubbling. - * false means that bubbling is not permitted. + * @param bool $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. * @return $this */ public function setBubble(bool $bubble): self diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php index 695a1c07f..4a7031706 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php @@ -55,7 +55,7 @@ public function __construct(string|int $facility = \LOG_USER, int|string|Level $ { parent::__construct($level, $bubble); - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + if (!\defined('PHP_WINDOWS_VERSION_BUILD')) { $this->facilities['local0'] = \LOG_LOCAL0; $this->facilities['local1'] = \LOG_LOCAL1; $this->facilities['local2'] = \LOG_LOCAL2; @@ -76,9 +76,9 @@ public function __construct(string|int $facility = \LOG_USER, int|string|Level $ } // convert textual description of facility to syslog constant - if (is_string($facility) && array_key_exists(strtolower($facility), $this->facilities)) { + if (\is_string($facility) && \array_key_exists(strtolower($facility), $this->facilities)) { $facility = $this->facilities[strtolower($facility)]; - } elseif (!in_array($facility, array_values($this->facilities), true)) { + } elseif (!\in_array($facility, array_values($this->facilities), true)) { throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AmqpHandler.php index 27d773ea4..119f33947 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/AmqpHandler.php @@ -56,7 +56,7 @@ public function getExtraAttributes(): array /** * Configure extra attributes to pass to the AMQPExchange (if you are using the amqp extension) * - * @param array $extraAttributes One of content_type, content_encoding, + * @param array $extraAttributes One of content_type, content_encoding, * message_id, user_id, app_id, delivery_mode, * priority, timestamp, expiration, type * or reply_to, headers. @@ -65,6 +65,7 @@ public function getExtraAttributes(): array public function setExtraAttributes(array $extraAttributes): self { $this->extraAttributes = $extraAttributes; + return $this; } @@ -155,6 +156,7 @@ private function createAmqpMessage(string $data): AMQPMessage if (\count($this->extraAttributes) > 0) { $attributes = array_merge($attributes, $this->extraAttributes); } + return new AMQPMessage($data, $attributes); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 5930ca488..0d75cb313 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -17,7 +17,6 @@ use Monolog\LogRecord; use Monolog\Level; -use function count; use function headers_list; use function stripos; @@ -77,7 +76,7 @@ public static function send(): void return; } - if (count(static::$records) > 0) { + if (\count(static::$records) > 0) { if ($format === self::FORMAT_HTML) { static::writeOutput(''); } else { // js format @@ -213,7 +212,7 @@ private static function handleStyles(string $formatted): array $args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0])); $pos = $match[0][1]; - $format = Utils::substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . Utils::substr($format, $pos + strlen($match[0][0])); + $format = Utils::substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . Utils::substr($format, $pos + \strlen($match[0][0])); } $args[] = self::quote('font-weight: normal'); @@ -231,7 +230,7 @@ private static function handleCustomStyles(string $style, string $string): strin if (trim($m[1]) === 'autolabel') { // Format the string as a label with consistent auto assigned background color if (!isset($labels[$string])) { - $labels[$string] = $colors[count($labels) % count($colors)]; + $labels[$string] = $colors[\count($labels) % \count($colors)]; } $color = $labels[$string]; @@ -284,7 +283,7 @@ private static function quote(string $arg): string private static function call(...$args): string { $method = array_shift($args); - if (!is_string($method)) { + if (!\is_string($method)) { throw new \UnexpectedValueException('Expected the first arg to be a string, got: '.var_export($method, true)); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BufferHandler.php index ff89faa8a..c241c32f2 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -148,7 +148,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface return $this; } - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($this->handler).' does not support formatters.'); } /** @@ -160,6 +160,6 @@ public function getFormatter(): FormatterInterface return $this->handler->getFormatter(); } - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($this->handler).' does not support formatters.'); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php index 2f7f21d5f..8b1cd5a3e 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -68,7 +68,7 @@ class ChromePHPHandler extends AbstractProcessingHandler public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); - if (!function_exists('json_encode')) { + if (!\function_exists('json_encode')) { throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler'); } } @@ -149,7 +149,7 @@ protected function send(): void $json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true); $data = base64_encode($json); - if (strlen($data) > 3 * 1024) { + if (\strlen($data) > 3 * 1024) { self::$overflowed = true; $record = new LogRecord( @@ -158,7 +158,7 @@ protected function send(): void channel: 'monolog', datetime: new DateTimeImmutable(true), ); - self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); + self::$json['rows'][\count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); $json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true); $data = base64_encode($json); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/CubeHandler.php index 8388f5ade..a76bf4089 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/CubeHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/CubeHandler.php @@ -47,7 +47,7 @@ public function __construct(string $url, int|string|Level $level = Level::Debug, throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); } - if (!in_array($urlInfo['scheme'], $this->acceptedSchemes, true)) { + if (!\in_array($urlInfo['scheme'], $this->acceptedSchemes, true)) { throw new \UnexpectedValueException( 'Invalid protocol (' . $urlInfo['scheme'] . ').' . ' Valid options are ' . implode(', ', $this->acceptedSchemes) @@ -69,7 +69,7 @@ public function __construct(string $url, int|string|Level $level = Level::Debug, */ protected function connectUdp(): void { - if (!extension_loaded('sockets')) { + if (!\extension_loaded('sockets')) { throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler'); } @@ -92,7 +92,7 @@ protected function connectUdp(): void */ protected function connectHttp(): void { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is required to use http URLs with the CubeHandler'); } @@ -143,7 +143,7 @@ private function writeUdp(string $data): void throw new \LogicException('No UDP socket could be opened'); } - socket_send($this->udpConnection, $data, strlen($data), 0); + socket_send($this->udpConnection, $data, \strlen($data), 0); } private function writeHttp(string $data): void @@ -159,7 +159,7 @@ private function writeHttp(string $data): void curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', - 'Content-Length: ' . strlen('['.$data.']'), + 'Content-Length: ' . \strlen('['.$data.']'), ]); Curl\Util::execute($this->httpConnection, 5, false); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Curl/Util.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Curl/Util.php index 4decf0e62..f10281144 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Curl/Util.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Curl/Util.php @@ -44,7 +44,7 @@ public static function execute(CurlHandle $ch, int $retries = 5, bool $closeAfte if ($curlResponse === false) { $curlErrno = curl_errno($ch); - if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || $retries === 0) { + if (false === \in_array($curlErrno, self::$retriableErrorCodes, true) || $retries === 0) { $curlError = curl_error($ch); if ($closeAfterDone) { diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php index 0ef2734f4..873a4b860 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php @@ -46,11 +46,11 @@ class DeduplicationHandler extends BufferHandler protected bool $gc = false; /** - * @param HandlerInterface $handler Handler. - * @param string|null $deduplicationStore The file/path where the deduplication log should be kept + * @param HandlerInterface $handler Handler. + * @param string|null $deduplicationStore The file/path where the deduplication log should be kept * @param int|string|Level|LogLevel::* $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes - * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * * @phpstan-param value-of|value-of|Level|LogLevel::* $deduplicationLevel */ @@ -79,11 +79,11 @@ public function flush(): void foreach ($this->buffer as $record) { if ($record->level->value >= $this->deduplicationLevel->value) { - $passthru = $passthru === true || !is_array($store) || !$this->isDuplicate($store, $record); + $passthru = $passthru === true || !\is_array($store) || !$this->isDuplicate($store, $record); if ($passthru) { $line = $this->buildDeduplicationStoreEntry($record); file_put_contents($this->deduplicationStore, $line . "\n", FILE_APPEND); - if (!is_array($store)) { + if (!\is_array($store)) { $store = []; } $store[] = $line; @@ -113,7 +113,7 @@ protected function isDuplicate(array $store, LogRecord $record): bool $expectedMessage = preg_replace('{[\r\n].*}', '', $record->message); $yesterday = time() - 86400; - for ($i = count($store) - 1; $i >= 0; $i--) { + for ($i = \count($store) - 1; $i >= 0; $i--) { list($timestamp, $level, $message) = explode(':', $store[$i], 3); if ($level === $record->level->getName() && $message === $expectedMessage && $timestamp > $timestampValidity) { @@ -155,7 +155,7 @@ private function collectLogs(): void while (!feof($handle)) { $log = fgets($handle); - if (is_string($log) && '' !== $log && substr($log, 0, 10) >= $timestampValidity) { + if (\is_string($log) && '' !== $log && substr($log, 0, 10) >= $timestampValidity) { $validLogs[] = $log; } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php index 571c439e1..aaad9d48c 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php @@ -40,7 +40,7 @@ public function __construct(int $messageType = self::OPERATING_SYSTEM, int|strin { parent::__construct($level, $bubble); - if (false === in_array($messageType, self::getAvailableTypes(), true)) { + if (false === \in_array($messageType, self::getAvailableTypes(), true)) { $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true)); throw new \InvalidArgumentException($message); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FilterHandler.php index 66f65477a..6653fa15a 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -54,10 +54,10 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese /** * @phpstan-param (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface $handler * - * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $filterHandler). + * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $filterHandler). * @param int|string|Level|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided - * @param int|string|Level|LogLevel::* $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|string|Level|LogLevel::* $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * * @phpstan-param value-of|value-of|Level|LogLevel::*|array|value-of|Level|LogLevel::*> $minLevelOrList * @phpstan-param value-of|value-of|Level|LogLevel::* $maxLevel @@ -78,8 +78,8 @@ public function getAcceptedLevels(): array } /** - * @param int|string|Level|LogLevel::*|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided - * @param int|string|Level|LogLevel::* $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array + * @param int|string|Level|LogLevel::*|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided + * @param int|string|Level|LogLevel::* $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array * @return $this * * @phpstan-param value-of|value-of|Level|LogLevel::*|array|value-of|Level|LogLevel::*> $minLevelOrList @@ -87,7 +87,7 @@ public function getAcceptedLevels(): array */ public function setAcceptedLevels(int|string|Level|array $minLevelOrList = Level::Debug, int|string|Level $maxLevel = Level::Emergency): self { - if (is_array($minLevelOrList)) { + if (\is_array($minLevelOrList)) { $acceptedLevels = array_map(Logger::toMonologLevel(...), $minLevelOrList); } else { $minLevelOrList = Logger::toMonologLevel($minLevelOrList); @@ -140,8 +140,8 @@ public function handleBatch(array $records): void } } - if (count($filtered) > 0) { - $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered); + if (\count($filtered) > 0) { + $this->getHandler($filtered[\count($filtered) - 1])->handleBatch($filtered); } } @@ -175,7 +175,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface return $this; } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } /** @@ -188,7 +188,7 @@ public function getFormatter(): FormatterInterface return $handler->getFormatter(); } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } public function reset(): void diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index d4551fb9c..76318307a 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -66,11 +66,11 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa /** * @phpstan-param (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface $handler * - * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $fingersCrossedHandler). + * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $fingersCrossedHandler). * @param int|string|Level|LogLevel::* $activationStrategy Strategy which determines when this handler takes action, or a level name/value at which the handler is activated - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) + * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) * @param int|string|Level|LogLevel::*|null $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered * * @phpstan-param value-of|value-of|Level|LogLevel::*|ActivationStrategyInterface $activationStrategy @@ -130,7 +130,7 @@ public function handle(LogRecord $record): bool if ($this->buffering) { $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { + if ($this->bufferSize > 0 && \count($this->buffer) > $this->bufferSize) { array_shift($this->buffer); } if ($this->activationStrategy->isHandlerActivated($record)) { @@ -185,7 +185,7 @@ private function flushBuffer(): void $this->buffer = array_filter($this->buffer, static function ($record) use ($passthruLevel) { return $passthruLevel->includes($record->level); }); - if (count($this->buffer) > 0) { + if (\count($this->buffer) > 0) { $this->getHandler(end($this->buffer))->handleBatch($this->buffer); } } @@ -224,7 +224,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface return $this; } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } /** @@ -237,6 +237,6 @@ public function getFormatter(): FormatterInterface return $handler->getFormatter(); } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php index 220648223..46ebfc0b7 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php @@ -54,7 +54,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if (!extension_loaded('openssl')) { + if (!\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler'); } @@ -112,7 +112,7 @@ private function buildHeader(string $content): string $header = "POST " . static::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n"; $header .= "Host: " . static::FLEEP_HOST . "\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "Content-Length: " . \strlen($content) . "\r\n"; $header .= "\r\n"; return $header; diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php index d24bec40b..27c6c1533 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -46,7 +46,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if (!extension_loaded('openssl')) { + if (!\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler'); } @@ -119,7 +119,7 @@ private function buildHeader(string $content): string $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; $header .= "Host: api.flowdock.com\r\n"; $header .= "Content-Type: application/json\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "Content-Length: " . \strlen($content) . "\r\n"; $header .= "\r\n"; return $header; diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/HandlerInterface.php index 83905c323..93306d961 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/HandlerInterface.php @@ -45,7 +45,7 @@ public function isHandling(LogRecord $record): bool; * * @param LogRecord $record The record to handle * @return bool true means that this handler handled the record, and that bubbling is not permitted. - * false means the record was either not processed or that this handler allows bubbling. + * false means the record was either not processed or that this handler allows bubbling. */ public function handle(LogRecord $record): bool; diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php index 418f2ba03..b9c7ba84b 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php @@ -39,7 +39,7 @@ class IFTTTHandler extends AbstractProcessingHandler */ public function __construct(string $eventName, string $secretKey, int|string|Level $level = Level::Error, bool $bubble = true) { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the IFTTTHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php index abb2f88f7..4b558bd65 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php @@ -43,7 +43,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if ($useSSL && !extension_loaded('openssl')) { + if ($useSSL && !\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php index 00259834e..8c12898e2 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -40,7 +40,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if ($useSSL && !extension_loaded('openssl')) { + if ($useSSL && !\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogglyHandler.php index 6a9a20e01..ff298c661 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogglyHandler.php @@ -14,7 +14,6 @@ use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogglyFormatter; -use function array_key_exists; use CurlHandle; use Monolog\LogRecord; @@ -50,7 +49,7 @@ class LogglyHandler extends AbstractProcessingHandler */ public function __construct(string $token, int|string|Level $level = Level::Debug, bool $bubble = true) { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the LogglyHandler'); } @@ -64,7 +63,7 @@ public function __construct(string $token, int|string|Level $level = Level::Debu */ protected function getCurlHandler(string $endpoint): CurlHandle { - if (!array_key_exists($endpoint, $this->curlHandlers)) { + if (!\array_key_exists($endpoint, $this->curlHandlers)) { $this->curlHandlers[$endpoint] = $this->loadCurlHandle($endpoint); } @@ -88,7 +87,7 @@ private function loadCurlHandle(string $endpoint): CurlHandle } /** - * @param string[]|string $tag + * @param string[]|string $tag * @return $this */ public function setTag(string|array $tag): self @@ -96,20 +95,20 @@ public function setTag(string|array $tag): self if ('' === $tag || [] === $tag) { $this->tag = []; } else { - $this->tag = is_array($tag) ? $tag : [$tag]; + $this->tag = \is_array($tag) ? $tag : [$tag]; } return $this; } /** - * @param string[]|string $tag + * @param string[]|string $tag * @return $this */ public function addTag(string|array $tag): self { if ('' !== $tag) { - $tag = is_array($tag) ? $tag : [$tag]; + $tag = \is_array($tag) ? $tag : [$tag]; $this->tag = array_unique(array_merge($this->tag, $tag)); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php index 876b1a953..6aa1b31bf 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php @@ -48,7 +48,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if ($useSSL && !extension_loaded('openssl')) { + if ($useSSL && !\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php index 70d6004e1..c68b1ddd0 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -78,7 +78,7 @@ public function __construct(string|array $to, string $subject, string $from, int /** * Add headers to the message * - * @param string|string[] $headers Custom added headers + * @param string|string[] $headers Custom added headers * @return $this */ public function addHeader($headers): self @@ -96,7 +96,7 @@ public function addHeader($headers): self /** * Add parameters to the message * - * @param string|string[] $parameters Custom added parameters + * @param string|string[] $parameters Custom added parameters * @return $this */ public function addParameter($parameters): self @@ -143,7 +143,7 @@ public function getEncoding(): string } /** - * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML messages. + * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML messages. * @return $this */ public function setContentType(string $contentType): self diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index b8cb3785b..4f28dd4a5 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -79,9 +79,9 @@ protected function write(LogRecord $record): void newrelic_notice_error($record->message); } - if (isset($record->formatted['context']) && is_array($record->formatted['context'])) { + if (isset($record->formatted['context']) && \is_array($record->formatted['context'])) { foreach ($record->formatted['context'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { + if (\is_array($parameter) && $this->explodeArrays) { foreach ($parameter as $paramKey => $paramValue) { $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); } @@ -91,9 +91,9 @@ protected function write(LogRecord $record): void } } - if (isset($record->formatted['extra']) && is_array($record->formatted['extra'])) { + if (isset($record->formatted['extra']) && \is_array($record->formatted['extra'])) { foreach ($record->formatted['extra'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { + if (\is_array($parameter) && $this->explodeArrays) { foreach ($parameter as $paramKey => $paramValue) { $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); } @@ -109,7 +109,7 @@ protected function write(LogRecord $record): void */ protected function isNewRelicEnabled(): bool { - return extension_loaded('newrelic'); + return \extension_loaded('newrelic'); } /** @@ -163,7 +163,7 @@ protected function setNewRelicTransactionName(string $transactionName): void */ protected function setNewRelicParameter(string $key, $value): void { - if (null === $value || is_scalar($value)) { + if (null === $value || \is_scalar($value)) { newrelic_add_custom_parameter($key, $value); } else { newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true)); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/OverflowHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/OverflowHandler.php index a72b7a11d..b213a98dc 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/OverflowHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/OverflowHandler.php @@ -122,7 +122,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface return $this; } - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($this->handler).' does not support formatters.'); } /** @@ -134,6 +134,6 @@ public function getFormatter(): FormatterInterface return $this->handler->getFormatter(); } - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($this->handler).' does not support formatters.'); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ProcessHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ProcessHandler.php index 9edc9ac54..8b68e6463 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ProcessHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ProcessHandler.php @@ -96,7 +96,7 @@ protected function write(LogRecord $record): void */ private function ensureProcessIsStarted(): void { - if (is_resource($this->process) === false) { + if (\is_resource($this->process) === false) { $this->startProcess(); $this->handleStartupErrors(); @@ -129,7 +129,7 @@ private function handleStartupErrors(): void $errors = $this->readProcessErrors(); - if (is_resource($this->process) === false || $errors !== '') { + if (\is_resource($this->process) === false || $errors !== '') { throw new \UnexpectedValueException( sprintf('The process "%s" could not be opened: ' . $errors, $this->command) ); @@ -175,7 +175,7 @@ protected function writeProcessInput(string $string): void */ public function close(): void { - if (is_resource($this->process)) { + if (\is_resource($this->process)) { foreach ($this->pipes as $pipe) { fclose($pipe); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/PushoverHandler.php index 615f12194..b2a78955a 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/PushoverHandler.php @@ -88,9 +88,9 @@ class PushoverHandler extends SocketHandler * to be retried for (every retry seconds). * * @param int|string|Level|LogLevel::* $highPriorityLevel The minimum logging level at which this handler will start - * sending "high priority" requests to the Pushover API + * sending "high priority" requests to the Pushover API * @param int|string|Level|LogLevel::* $emergencyLevel The minimum logging level at which this handler will start - * sending "emergency" requests to the Pushover API + * sending "emergency" requests to the Pushover API * * * @phpstan-param string|array $users @@ -145,7 +145,7 @@ protected function generateDataStream(LogRecord $record): string private function buildContent(LogRecord $record): string { // Pushover has a limit of 512 characters on title and message combined. - $maxMessageLength = 512 - strlen($this->title); + $maxMessageLength = 512 - \strlen($this->title); $message = ($this->useFormattedMessage) ? $record->formatted : $record->message; $message = Utils::substr($message, 0, $maxMessageLength); @@ -176,7 +176,7 @@ private function buildContent(LogRecord $record): string $dataArray = array_merge($extra, $context, $dataArray); // Only pass sounds that are supported by the API - if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds, true)) { + if (isset($dataArray['sound']) && !\in_array($dataArray['sound'], $this->sounds, true)) { unset($dataArray['sound']); } @@ -188,7 +188,7 @@ private function buildHeader(string $content): string $header = "POST /1/messages.json HTTP/1.1\r\n"; $header .= "Host: api.pushover.net\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "Content-Length: " . \strlen($content) . "\r\n"; $header .= "\r\n"; return $header; @@ -207,7 +207,7 @@ protected function write(LogRecord $record): void } /** - * @param int|string|Level|LogLevel::* $level + * @param int|string|Level|LogLevel::* $level * @return $this * * @phpstan-param value-of|value-of|Level|LogLevel::* $level @@ -220,7 +220,7 @@ public function setHighPriorityLevel(int|string|Level $level): self } /** - * @param int|string|Level|LogLevel::* $level + * @param int|string|Level|LogLevel::* $level * @return $this * * @phpstan-param value-of|value-of|Level|LogLevel::* $level diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RedisHandler.php index 977f32c75..66cb324f5 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -24,7 +24,7 @@ * usage example: * * $log = new Logger('application'); - * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod"); + * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs"); * $log->pushHandler($redis); * * @author Thomas Tourlourat @@ -69,7 +69,7 @@ protected function write(LogRecord $record): void protected function writeCapped(LogRecord $record): void { if ($this->redisClient instanceof Redis) { - $mode = defined('Redis::MULTI') ? Redis::MULTI : 1; + $mode = \defined('Redis::MULTI') ? Redis::MULTI : 1; $this->redisClient->multi($mode) ->rPush($this->redisKey, $record->formatted) ->lTrim($this->redisKey, -$this->capSize, -1) diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index 86240b44f..32a496b3b 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -133,7 +133,7 @@ protected function rotate(): void return; } - if ($this->maxFiles >= count($logFiles)) { + if ($this->maxFiles >= \count($logFiles)) { // no files to remove return; } @@ -143,7 +143,7 @@ protected function rotate(): void return strcmp($b, $a); }); - foreach (array_slice($logFiles, $this->maxFiles) as $file) { + foreach (\array_slice($logFiles, $this->maxFiles) as $file) { if (is_writable($file)) { // suppress errors here as unlink() might fail if two processes // are cleaning up/rotating at the same time @@ -182,8 +182,8 @@ protected function getGlobPattern(): string [$fileInfo['filename'], str_replace( ['Y', 'y', 'm', 'd'], ['[0-9][0-9][0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]'], - $this->dateFormat) - ], + $this->dateFormat + )], ($fileInfo['dirname'] ?? '') . '/' . $this->filenameFormat ); if (isset($fileInfo['extension'])) { diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index db43d5a85..1b10580f2 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -103,7 +103,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface return $this; } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } /** @@ -116,6 +116,6 @@ public function getFormatter(): FormatterInterface return $handler->getFormatter(); } - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); + throw new \UnexpectedValueException('The nested handler of type '.\get_class($handler).' does not support formatters.'); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SendGridHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SendGridHandler.php index b8f574bb4..0a6fe406b 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SendGridHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SendGridHandler.php @@ -57,7 +57,7 @@ class SendGridHandler extends MailHandler */ public function __construct(string $apiUser, string $apiKey, string $from, string|array $to, string $subject, int|string|Level $level = Level::Error, bool $bubble = true) { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the SendGridHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index 0cb8b9b4a..a10d6d6c8 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -220,7 +220,7 @@ public function stringify(array $fields): string /** * Channel used by the bot when posting * - * @param ?string $channel + * @param ?string $channel * @return $this */ public function setChannel(?string $channel = null): self @@ -233,7 +233,7 @@ public function setChannel(?string $channel = null): self /** * Username used by the bot when posting * - * @param ?string $username + * @param ?string $username * @return $this */ public function setUsername(?string $username = null): self @@ -292,7 +292,7 @@ public function includeContextAndExtra(bool $includeContextAndExtra = false): se } /** - * @param string[] $excludeFields + * @param string[] $excludeFields * @return $this */ public function excludeFields(array $excludeFields = []): self @@ -321,7 +321,7 @@ public function setFormatter(?FormatterInterface $formatter = null): self */ private function generateAttachmentField(string $title, $value): array { - $value = is_array($value) + $value = \is_array($value) ? sprintf('```%s```', substr($this->stringify($value), 0, 1990)) : $value; diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackHandler.php index 1d9a17712..2a34dda2d 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -63,7 +63,7 @@ public function __construct( ?float $connectionTimeout = null, ?int $chunkSize = null ) { - if (!extension_loaded('openssl')) { + if (!\extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); } @@ -129,7 +129,7 @@ protected function prepareContentData(LogRecord $record): array $dataArray = $this->slackRecord->getSlackData($record); $dataArray['token'] = $this->token; - if (isset($dataArray['attachments']) && is_array($dataArray['attachments']) && \count($dataArray['attachments']) > 0) { + if (isset($dataArray['attachments']) && \is_array($dataArray['attachments']) && \count($dataArray['attachments']) > 0) { $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); } @@ -144,7 +144,7 @@ private function buildHeader(string $content): string $header = "POST /api/chat.postMessage HTTP/1.1\r\n"; $header .= "Host: slack.com\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "Content-Length: " . \strlen($content) . "\r\n"; $header .= "\r\n"; return $header; @@ -168,7 +168,7 @@ protected function write(LogRecord $record): void protected function finalizeWrite(): void { $res = $this->getResource(); - if (is_resource($res)) { + if (\is_resource($res)) { @fread($res, 2048); } $this->closeSocket(); @@ -255,7 +255,7 @@ public function includeContextAndExtra(bool $includeContextAndExtra): self } /** - * @param string[] $excludeFields + * @param string[] $excludeFields * @return $this */ public function excludeFields(array $excludeFields): self diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index c69237aeb..eac51ccbe 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -59,7 +59,7 @@ public function __construct( bool $bubble = true, array $excludeFields = [] ) { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the SlackWebhookHandler'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SocketHandler.php index 63f437f3f..69a036f52 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -63,7 +63,7 @@ public function __construct( $this->validateTimeout($connectionTimeout); } - $this->connectionTimeout = $connectionTimeout ?? (float) ini_get('default_socket_timeout'); + $this->connectionTimeout = $connectionTimeout ?? (float) \ini_get('default_socket_timeout'); $this->persistent = $persistent; $this->validateTimeout($timeout); $this->timeout = $timeout; @@ -102,7 +102,7 @@ public function close(): void */ public function closeSocket(): void { - if (is_resource($this->resource)) { + if (\is_resource($this->resource)) { fclose($this->resource); $this->resource = null; } @@ -151,7 +151,7 @@ public function setTimeout(float $seconds): self /** * Set writing timeout. Only has effect during connection in the writing cycle. * - * @param float $seconds 0 for no timeout + * @param float $seconds 0 for no timeout * @return $this */ public function setWritingTimeout(float $seconds): self @@ -229,7 +229,7 @@ public function getChunkSize(): ?int */ public function isConnected(): bool { - return is_resource($this->resource) + return \is_resource($this->resource) && !feof($this->resource); // on TCP - other party can close connection. } @@ -263,7 +263,7 @@ protected function streamSetTimeout(): bool $seconds = floor($this->timeout); $microseconds = round(($this->timeout - $seconds) * 1e6); - if (!is_resource($this->resource)) { + if (!\is_resource($this->resource)) { throw new \LogicException('streamSetTimeout called but $this->resource is not a resource'); } @@ -279,7 +279,7 @@ protected function streamSetTimeout(): bool */ protected function streamSetChunkSize(): int|bool { - if (!is_resource($this->resource)) { + if (!\is_resource($this->resource)) { throw new \LogicException('streamSetChunkSize called but $this->resource is not a resource'); } @@ -297,7 +297,7 @@ protected function streamSetChunkSize(): int|bool */ protected function fwrite(string $data): int|bool { - if (!is_resource($this->resource)) { + if (!\is_resource($this->resource)) { throw new \LogicException('fwrite called but $this->resource is not a resource'); } @@ -311,7 +311,7 @@ protected function fwrite(string $data): int|bool */ protected function streamGetMetadata(): array|bool { - if (!is_resource($this->resource)) { + if (!\is_resource($this->resource)) { throw new \LogicException('streamGetMetadata called but $this->resource is not a resource'); } @@ -360,7 +360,7 @@ private function createSocketResource(): void } else { $resource = $this->fsockopen(); } - if (is_bool($resource)) { + if (\is_bool($resource)) { throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); } $this->resource = $resource; @@ -382,7 +382,7 @@ private function setStreamChunkSize(): void private function writeToSocket(string $data): void { - $length = strlen($data); + $length = \strlen($data); $sent = 0; $this->lastSentBytes = $sent; while ($this->isConnected() && $sent < $length) { @@ -396,7 +396,7 @@ private function writeToSocket(string $data): void } $sent += $chunk; $socketInfo = $this->streamGetMetadata(); - if (is_array($socketInfo) && (bool) $socketInfo['timed_out']) { + if (\is_array($socketInfo) && (bool) $socketInfo['timed_out']) { throw new \RuntimeException("Write timed-out"); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SqsHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SqsHandler.php index b4512a601..1d28b65d4 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SqsHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SqsHandler.php @@ -44,12 +44,12 @@ public function __construct(SqsClient $sqsClient, string $queueUrl, int|string|L */ protected function write(LogRecord $record): void { - if (!isset($record->formatted) || 'string' !== gettype($record->formatted)) { + if (!isset($record->formatted) || 'string' !== \gettype($record->formatted)) { throw new \InvalidArgumentException('SqsHandler accepts only formatted records as a string' . Utils::getRecordMessageForException($record)); } $messageBody = $record->formatted; - if (strlen($messageBody) >= static::MAX_MESSAGE_SIZE) { + if (\strlen($messageBody) >= static::MAX_MESSAGE_SIZE) { $messageBody = Utils::substr($messageBody, 0, static::HEAD_MESSAGE_SIZE); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/StreamHandler.php index a87577c8d..416909583 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -48,7 +48,7 @@ public function __construct($stream, int|string|Level $level = Level::Debug, boo { parent::__construct($level, $bubble); - if (($phpMemoryLimit = Utils::expandIniShorthandBytes(ini_get('memory_limit'))) !== false) { + if (($phpMemoryLimit = Utils::expandIniShorthandBytes(\ini_get('memory_limit'))) !== false) { if ($phpMemoryLimit > 0) { // use max 10% of allowed memory for the chunk size, and at least 100KB $this->streamChunkSize = min(static::MAX_CHUNK_SIZE, max((int) ($phpMemoryLimit / 10), 100 * 1024)); @@ -61,11 +61,11 @@ public function __construct($stream, int|string|Level $level = Level::Debug, boo $this->streamChunkSize = static::DEFAULT_CHUNK_SIZE; } - if (is_resource($stream)) { + if (\is_resource($stream)) { $this->stream = $stream; stream_set_chunk_size($this->stream, $this->streamChunkSize); - } elseif (is_string($stream)) { + } elseif (\is_string($stream)) { $this->url = Utils::canonicalizePath($stream); } else { throw new \InvalidArgumentException('A stream must either be a resource or a string.'); @@ -80,7 +80,7 @@ public function __construct($stream, int|string|Level $level = Level::Debug, boo */ public function close(): void { - if (null !== $this->url && is_resource($this->stream)) { + if (null !== $this->url && \is_resource($this->stream)) { fclose($this->stream); } $this->stream = null; @@ -115,14 +115,17 @@ public function getStreamChunkSize(): int */ protected function write(LogRecord $record): void { - if (!is_resource($this->stream)) { + if (!\is_resource($this->stream)) { $url = $this->url; if (null === $url || '' === $url) { throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().' . Utils::getRecordMessageForException($record)); } $this->createDir($url); $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); + set_error_handler(function (...$args) { + return $this->customErrorHandler(...$args); + }); + try { $stream = fopen($url, 'a'); if ($this->filePermission !== null) { @@ -131,7 +134,7 @@ protected function write(LogRecord $record): void } finally { restore_error_handler(); } - if (!is_resource($stream)) { + if (!\is_resource($stream)) { $this->stream = null; throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $url) . Utils::getRecordMessageForException($record)); @@ -173,11 +176,11 @@ private function getDirFromStream(string $stream): ?string { $pos = strpos($stream, '://'); if ($pos === false) { - return dirname($stream); + return \dirname($stream); } if ('file://' === substr($stream, 0, 7)) { - return dirname(substr($stream, 7)); + return \dirname(substr($stream, 7)); } return null; @@ -193,7 +196,9 @@ private function createDir(string $url): void $dir = $this->getDirFromStream($url); if (null !== $dir && !is_dir($dir)) { $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); + set_error_handler(function (...$args) { + return $this->customErrorHandler(...$args); + }); $status = mkdir($dir, 0777, true); restore_error_handler(); if (false === $status && !is_dir($dir) && strpos((string) $this->errorMessage, 'File exists') === false) { diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php index 842b6577f..33aa4fd7b 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php @@ -13,7 +13,6 @@ use Closure; use Monolog\Level; -use Monolog\Logger; use Monolog\LogRecord; use Monolog\Utils; use Monolog\Formatter\FormatterInterface; @@ -68,20 +67,21 @@ protected function getSubjectFormatter(?string $format): FormatterInterface /** * Creates instance of Email to be sent * - * @param string $content formatted email body to be sent - * @param LogRecord[] $records Log records that formed the content + * @param string $content formatted email body to be sent + * @param LogRecord[] $records Log records that formed the content */ protected function buildMessage(string $content, array $records): Email { $message = null; if ($this->emailTemplate instanceof Email) { $message = clone $this->emailTemplate; - } elseif (is_callable($this->emailTemplate)) { + } elseif (\is_callable($this->emailTemplate)) { $message = ($this->emailTemplate)($content, $records); } if (!$message instanceof Email) { $record = reset($records); + throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it' . ($record instanceof LogRecord ? Utils::getRecordMessageForException($record) : '')); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogHandler.php index 99507a170..f3d7674c2 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogHandler.php @@ -12,7 +12,6 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Utils; use Monolog\LogRecord; /** diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php index 6a4833450..3ff0bce5f 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php @@ -65,12 +65,12 @@ protected function getSocket(): Socket protected function send(string $chunk): void { - socket_sendto($this->getSocket(), $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); + socket_sendto($this->getSocket(), $chunk, \strlen($chunk), $flags = 0, $this->ip, $this->port); } protected function assembleMessage(string $line, string $header): string { - $chunkSize = static::DATAGRAM_MAX_LENGTH - strlen($header); + $chunkSize = static::DATAGRAM_MAX_LENGTH - \strlen($header); return $header . Utils::substr($line, 0, $chunkSize); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php index 607409353..e8db4cdeb 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -54,7 +54,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler */ public function __construct(string $host, int $port = 514, string|int $facility = LOG_USER, int|string|Level $level = Level::Debug, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424) { - if (!extension_loaded('sockets')) { + if (!\extension_loaded('sockets')) { throw new MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler'); } @@ -88,7 +88,7 @@ public function close(): void */ private function splitMessageIntoLines($message): array { - if (is_array($message)) { + if (\is_array($message)) { $message = implode("\n", $message); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php index 8fda76977..e4f69a9ff 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php @@ -118,7 +118,7 @@ public function __construct( bool $delayBetweenMessages = false, int $topic = null ) { - if (!extension_loaded('curl')) { + if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the TelegramBotHandler'); } @@ -139,7 +139,7 @@ public function __construct( */ public function setParseMode(string|null $parseMode = null): self { - if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES, true)) { + if ($parseMode !== null && !\in_array($parseMode, self::AVAILABLE_PARSE_MODES, true)) { throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.'); } @@ -271,7 +271,7 @@ protected function sendCurl(string $message): void curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params)); $result = Curl\Util::execute($ch); - if (!is_string($result)) { + if (!\is_string($result)) { throw new RuntimeException('Telegram API error. Description: No response'); } $result = json_decode($result, true); @@ -288,8 +288,8 @@ protected function sendCurl(string $message): void private function handleMessageLength(string $message): array { $truncatedMarker = ' (...truncated)'; - if (!$this->splitLongMessages && strlen($message) > self::MAX_MESSAGE_LENGTH) { - return [Utils::substr($message, 0, self::MAX_MESSAGE_LENGTH - strlen($truncatedMarker)) . $truncatedMarker]; + if (!$this->splitLongMessages && \strlen($message) > self::MAX_MESSAGE_LENGTH) { + return [Utils::substr($message, 0, self::MAX_MESSAGE_LENGTH - \strlen($truncatedMarker)) . $truncatedMarker]; } return str_split($message, self::MAX_MESSAGE_LENGTH); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TestHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TestHandler.php index 8e356ef31..a98389b95 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TestHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/TestHandler.php @@ -119,7 +119,7 @@ public function hasRecords(int|string|Level $level): bool */ public function hasRecord(string|array $recordAssertions, Level $level): bool { - if (is_string($recordAssertions)) { + if (\is_string($recordAssertions)) { $recordAssertions = ['message' => $recordAssertions]; } @@ -181,15 +181,15 @@ public function __call(string $method, array $args): bool { if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = constant(Level::class.'::' . $matches[2]); + $level = \constant(Level::class.'::' . $matches[2]); $callback = [$this, $genericMethod]; - if (is_callable($callback)) { + if (\is_callable($callback)) { $args[] = $level; - return call_user_func_array($callback, $args); + return \call_user_func_array($callback, $args); } } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + throw new \BadMethodCallException('Call to undefined method ' . \get_class($this) . '::' . $method . '()'); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php index 1e71194bc..8841f2f14 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php @@ -29,7 +29,7 @@ class ZendMonitorHandler extends AbstractProcessingHandler */ public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true) { - if (!function_exists('zend_monitor_custom_event')) { + if (!\function_exists('zend_monitor_custom_event')) { throw new MissingExtensionException( 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' ); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Level.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Level.php index 097d42135..5620bc4de 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Level.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Level.php @@ -82,7 +82,7 @@ enum Level: int case Emergency = 600; /** - * @param value-of|LogLevel::*|'Debug'|'Info'|'Notice'|'Warning'|'Error'|'Critical'|'Alert'|'Emergency' $name + * @param value-of|LogLevel::*|'Debug'|'Info'|'Notice'|'Warning'|'Error'|'Critical'|'Alert'|'Emergency' $name * @return static */ public static function fromName(string $name): self @@ -100,7 +100,7 @@ public static function fromName(string $name): self } /** - * @param value-of $value + * @param value-of $value * @return static */ public static function fromValue(int $value): self diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/LogRecord.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/LogRecord.php index df758c58b..14c82f304 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/LogRecord.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/LogRecord.php @@ -17,7 +17,7 @@ * Monolog log record * * @author Jordi Boggiano - * @template-implements ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra', int|string|\DateTimeImmutable|array> + * @template-implements ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra'|'formatted', int|string|\DateTimeImmutable|array> */ class LogRecord implements ArrayAccess { @@ -42,7 +42,7 @@ public function __construct( public function offsetSet(mixed $offset, mixed $value): void { if ($offset === 'extra') { - if (!is_array($value)) { + if (!\is_array($value)) { throw new \InvalidArgumentException('extra must be an array'); } @@ -76,13 +76,16 @@ public function offsetUnset(mixed $offset): void public function &offsetGet(mixed $offset): mixed { - if ($offset === 'level_name' || $offset === 'level') { + // handle special cases for the level enum + if ($offset === 'level_name') { // avoid returning readonly props by ref as this is illegal - if ($offset === 'level_name') { - $copy = $this->level->getName(); - } else { - $copy = $this->level->value; - } + $copy = $this->level->getName(); + + return $copy; + } + if ($offset === 'level') { + // avoid returning readonly props by ref as this is illegal + $copy = $this->level->value; return $copy; } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Logger.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Logger.php index f33c08f88..edc62f3a8 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Logger.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Logger.php @@ -230,7 +230,7 @@ public function popHandler(): HandlerInterface * * If a map is passed, keys will be ignored. * - * @param list $handlers + * @param list $handlers * @return $this */ public function setHandlers(array $handlers): self @@ -297,7 +297,7 @@ public function getProcessors(): array * by default. This function lets you disable them though in case you want * to suppress microseconds from the output. * - * @param bool $micro True to use microtime() to create timestamps + * @param bool $micro True to use microtime() to create timestamps * @return $this */ public function useMicrosecondTimestamps(bool $micro): self @@ -330,7 +330,7 @@ public function useLoggingLoopDetection(bool $detectCycles): self */ public function addRecord(int|Level $level, string $message, array $context = [], DateTimeImmutable|null $datetime = null): bool { - if (is_int($level) && isset(self::RFC_5424_LEVELS[$level])) { + if (\is_int($level) && isset(self::RFC_5424_LEVELS[$level])) { $level = self::RFC_5424_LEVELS[$level]; } @@ -346,13 +346,14 @@ public function addRecord(int|Level $level, string $message, array $context = [] if ($logDepth === 3) { $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); + return false; } elseif ($logDepth >= 5) { // log depth 4 is let through, so we can log the warning above return false; } try { - $recordInitialized = count($this->processors) === 0; + $recordInitialized = \count($this->processors) === 0; $record = new LogRecord( datetime: $datetime ?? new DateTimeImmutable($this->microsecondTimestamps, $this->timezone), @@ -470,8 +471,8 @@ public static function getLevelName(int|Level $level): string /** * Converts PSR-3 levels to Monolog ones if necessary * - * @param int|string|Level|LogLevel::* $level Level number (monolog) or name (PSR-3) - * @throws \Psr\Log\InvalidArgumentException If level is not defined + * @param int|string|Level|LogLevel::* $level Level number (monolog) or name (PSR-3) + * @throws \Psr\Log\InvalidArgumentException If level is not defined * * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ @@ -482,7 +483,7 @@ public static function toMonologLevel(string|int|Level $level): Level } if (\is_string($level)) { - if (\is_numeric($level)) { + if (is_numeric($level)) { $levelEnum = Level::tryFrom((int) $level); if ($levelEnum === null) { throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', Level::NAMES + Level::VALUES)); @@ -494,8 +495,8 @@ public static function toMonologLevel(string|int|Level $level): Level // Contains first char of all log levels and avoids using strtoupper() which may have // strange results depending on locale (for example, "i" will become "Ä°" in Turkish locale) $upper = strtr(substr($level, 0, 1), 'dinweca', 'DINWECA') . strtolower(substr($level, 1)); - if (defined(Level::class.'::'.$upper)) { - return constant(Level::class . '::' . $upper); + if (\defined(Level::class.'::'.$upper)) { + return \constant(Level::class . '::' . $upper); } throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', Level::NAMES + Level::VALUES)); @@ -565,7 +566,7 @@ public function getExceptionHandler(): Closure|null public function log($level, string|\Stringable $message, array $context = []): void { if (!$level instanceof Level) { - if (!is_string($level) && !is_int($level)) { + if (!\is_string($level) && !\is_int($level)) { throw new \InvalidArgumentException('$level is expected to be a string, int or '.Level::class.' instance'); } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/GitProcessor.php index 5a70ac2e2..6b25505de 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/GitProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/GitProcessor.php @@ -63,7 +63,7 @@ private static function getGitInfo(): array } $branches = shell_exec('git branch -v --no-abbrev'); - if (is_string($branches) && 1 === preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { + if (\is_string($branches) && 1 === preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { return self::$cache = [ 'branch' => $matches[1], 'commit' => $matches[2], diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php index 3a6fbfbef..efc2f50aa 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php @@ -43,7 +43,7 @@ class IntrospectionProcessor implements ProcessorInterface /** * @param string|int|Level $level The minimum logging level at which this Processor will be triggered - * @param string[] $skipClassesPartials + * @param string[] $skipClassesPartials * * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ @@ -82,7 +82,7 @@ public function __invoke(LogRecord $record): LogRecord continue 2; } } - } elseif (in_array($trace[$i]['function'], self::SKIP_FUNCTIONS, true)) { + } elseif (\in_array($trace[$i]['function'], self::SKIP_FUNCTIONS, true)) { $i++; continue; @@ -117,6 +117,6 @@ private function isTraceClassOrSkippedFunction(array $trace, int $index): bool return false; } - return isset($trace[$index]['class']) || in_array($trace[$index]['function'], self::SKIP_FUNCTIONS, true); + return isset($trace[$index]['class']) || \in_array($trace[$index]['function'], self::SKIP_FUNCTIONS, true); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/LoadAverageProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/LoadAverageProcessor.php index 64e3c4747..762ed9142 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/LoadAverageProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/LoadAverageProcessor.php @@ -40,7 +40,7 @@ class LoadAverageProcessor implements ProcessorInterface */ public function __construct(int $avgSystemLoad = self::LOAD_1_MINUTE) { - if (!in_array($avgSystemLoad, self::AVAILABLE_LOAD, true)) { + if (!\in_array($avgSystemLoad, self::AVAILABLE_LOAD, true)) { throw new \InvalidArgumentException(sprintf('Invalid average system load: `%s`', $avgSystemLoad)); } $this->avgSystemLoad = $avgSystemLoad; @@ -51,7 +51,7 @@ public function __construct(int $avgSystemLoad = self::LOAD_1_MINUTE) */ public function __invoke(LogRecord $record): LogRecord { - if (!function_exists('sys_getloadavg')) { + if (!\function_exists('sys_getloadavg')) { return $record; } $usage = sys_getloadavg(); diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php index 47b1e64ff..a48a78544 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php @@ -63,7 +63,7 @@ private static function getMercurialInfo(): array $result = explode(' ', trim((string) shell_exec('hg id -nb'))); - if (count($result) >= 3) { + if (\count($result) >= 3) { return self::$cache = [ 'branch' => $result[1], 'revision' => $result[2], diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php index aad2aad2f..76adf258f 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -57,7 +57,7 @@ public function __invoke(LogRecord $record): LogRecord continue; } - if (null === $val || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { + if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, "__toString"))) { $replacements[$placeholder] = $val; } elseif ($val instanceof \DateTimeInterface) { if (null === $this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) { @@ -69,12 +69,12 @@ public function __invoke(LogRecord $record): LogRecord } } elseif ($val instanceof \UnitEnum) { $replacements[$placeholder] = $val instanceof \BackedEnum ? $val->value : $val->name; - } elseif (is_object($val)) { + } elseif (\is_object($val)) { $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; - } elseif (is_array($val)) { + } elseif (\is_array($val)) { $replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true); } else { - $replacements[$placeholder] = '['.gettype($val).']'; + $replacements[$placeholder] = '['.\gettype($val).']'; } if ($this->removeUsedContextFields) { diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/TagProcessor.php index 10ed1cea3..f4e41ce20 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/TagProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/TagProcessor.php @@ -32,7 +32,7 @@ public function __construct(array $tags = []) } /** - * @param string[] $tags + * @param string[] $tags * @return $this */ public function addTags(array $tags = []): self @@ -43,7 +43,7 @@ public function addTags(array $tags = []): self } /** - * @param string[] $tags + * @param string[] $tags * @return $this */ public function setTags(array $tags = []): self diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/UidProcessor.php index 3a0c128c2..261e65389 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/UidProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/UidProcessor.php @@ -53,7 +53,7 @@ public function getUid(): string public function reset(): void { - $this->uid = $this->generateUid(strlen($this->uid)); + $this->uid = $this->generateUid(\strlen($this->uid)); } /** diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 1abb8400c..b78385e0c 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -65,7 +65,7 @@ public function __construct(array|ArrayAccess|null $serverData = null, array|nul } if (isset($extraFields[0])) { foreach (array_keys($this->extraFields) as $fieldName) { - if (!in_array($fieldName, $extraFields, true)) { + if (!\in_array($fieldName, $extraFields, true)) { unset($this->extraFields[$fieldName]); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/SignalHandler.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/SignalHandler.php index b930ca439..b6a69fca0 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/SignalHandler.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/SignalHandler.php @@ -44,7 +44,7 @@ public function __construct(LoggerInterface $logger) */ public function registerSignalHandler(int $signo, int|string|Level $level = LogLevel::CRITICAL, bool $callPrevious = true, bool $restartSyscalls = true, ?bool $async = true): self { - if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { + if (!\extension_loaded('pcntl') || !\function_exists('pcntl_signal')) { return $this; } @@ -76,10 +76,10 @@ public function handleSignal(int $signo, $siginfo = null): void /** @var array $signals */ static $signals = []; - if (\count($signals) === 0 && extension_loaded('pcntl')) { + if (\count($signals) === 0 && \extension_loaded('pcntl')) { $pcntl = new ReflectionExtension('pcntl'); foreach ($pcntl->getConstants() as $name => $value) { - if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { + if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && \is_int($value)) { $signals[$value] = $name; } } @@ -95,8 +95,8 @@ public function handleSignal(int $signo, $siginfo = null): void } if ($this->previousSignalHandler[$signo] === SIG_DFL) { - if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') - && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill') + if (\extension_loaded('pcntl') && \function_exists('pcntl_signal') && \function_exists('pcntl_sigprocmask') && \function_exists('pcntl_signal_dispatch') + && \extension_loaded('posix') && \function_exists('posix_getpid') && \function_exists('posix_kill') ) { $restartSyscalls = $this->signalRestartSyscalls[$signo] ?? true; pcntl_signal($signo, SIG_DFL, $restartSyscalls); @@ -106,7 +106,7 @@ public function handleSignal(int $signo, $siginfo = null): void pcntl_sigprocmask(SIG_SETMASK, $oldset); pcntl_signal($signo, [$this, 'handleSignal'], $restartSyscalls); } - } elseif (is_callable($this->previousSignalHandler[$signo])) { + } elseif (\is_callable($this->previousSignalHandler[$signo])) { $this->previousSignalHandler[$signo]($signo, $siginfo); } } diff --git a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Utils.php b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Utils.php index 7848f0ecd..79ea96ca3 100644 --- a/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Utils.php +++ b/lam/lib/3rdParty/composer/monolog/monolog/src/Monolog/Utils.php @@ -19,12 +19,12 @@ public static function getClass(object $object): string { $class = \get_class($object); - if (false === ($pos = \strpos($class, "@anonymous\0"))) { + if (false === ($pos = strpos($class, "@anonymous\0"))) { return $class; } - if (false === ($parent = \get_parent_class($class))) { - return \substr($class, 0, $pos + 10); + if (false === ($parent = get_parent_class($class))) { + return substr($class, 0, $pos + 10); } return $parent . '@anonymous'; @@ -32,11 +32,11 @@ public static function getClass(object $object): string public static function substr(string $string, int $start, ?int $length = null): string { - if (extension_loaded('mbstring')) { + if (\extension_loaded('mbstring')) { return mb_strcut($string, $start, $length); } - return substr($string, $start, (null === $length) ? strlen($string) : $length); + return substr($string, $start, (null === $length) ? \strlen($string) : $length); } /** @@ -119,9 +119,9 @@ public static function handleJsonError(int $code, $data, ?int $encodeFlags = nul self::throwEncodeError($code, $data); } - if (is_string($data)) { + if (\is_string($data)) { self::detectAndCleanUtf8($data); - } elseif (is_array($data)) { + } elseif (\is_array($data)) { array_walk_recursive($data, ['Monolog\Utils', 'detectAndCleanUtf8']); } else { self::throwEncodeError($code, $data); @@ -196,15 +196,15 @@ private static function throwEncodeError(int $code, $data): never */ private static function detectAndCleanUtf8(&$data): void { - if (is_string($data) && preg_match('//u', $data) !== 1) { + if (\is_string($data) && preg_match('//u', $data) !== 1) { $data = preg_replace_callback( '/[\x80-\xFF]+/', function (array $m): string { - return function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]); + return \function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]); }, $data ); - if (!is_string($data)) { + if (!\is_string($data)) { $pcreErrorCode = preg_last_error(); throw new \RuntimeException('Failed to preg_replace_callback: ' . $pcreErrorCode . ' / ' . self::pcreLastErrorMessage($pcreErrorCode)); @@ -225,7 +225,7 @@ function (array $m): string { */ public static function expandIniShorthandBytes($val) { - if (!is_string($val)) { + if (!\is_string($val)) { return false; } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/BACKERS.md b/lam/lib/3rdParty/composer/phpseclib/phpseclib/BACKERS.md index efca482ad..946b8f5f0 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/BACKERS.md +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/BACKERS.md @@ -14,4 +14,5 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co - Tharyrok - [cjhaas](https://github.com/cjhaas) - [istiak-tridip](https://github.com/istiak-tridip) -- [Anna Filina](https://github.com/afilina) \ No newline at end of file +- [Anna Filina](https://github.com/afilina) +- [blakemckeeby](https://github.com/blakemckeeby) \ No newline at end of file diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/composer.json b/lam/lib/3rdParty/composer/phpseclib/phpseclib/composer.json index 5052d5fb2..d996700e2 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/composer.json +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/composer.json @@ -52,7 +52,7 @@ ], "require": { "php": ">=5.6.1", - "paragonie/constant_time_encoding": "^1|^2", + "paragonie/constant_time_encoding": "^1|^2|^3", "paragonie/random_compat": "^1.4|^2.0|^9.99.99" }, "require-dev": { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php index eac793a69..fa750ba28 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php @@ -473,7 +473,7 @@ public static function base64url_encode($data) // return str_replace(['+', '/'], ['-', '_'], self::base64_encode($data)); return function_exists('sodium_bin2base64') ? - sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE) : + sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING) : Base64UrlSafe::encode($data); } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php index 122507089..3cb2b3055 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php @@ -151,13 +151,13 @@ class Blowfish extends BlockCipher protected $cfb_init_len = 500; /** - * The fixed subkeys boxes ($sbox0 - $sbox3) with 256 entries each + * The fixed subkeys boxes * - * S-Box 0 + * S-Box * * @var array */ - private static $sbox0 = [ + private static $sbox = [ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, @@ -189,15 +189,8 @@ class Blowfish extends BlockCipher 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a - ]; + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, - /** - * S-Box 1 - * - * @var array - */ - private static $sbox1 = [ 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, @@ -229,15 +222,8 @@ class Blowfish extends BlockCipher 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 - ]; + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, - /** - * S-Box 2 - * - * @var array - */ - private static $sbox2 = [ 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, @@ -269,15 +255,8 @@ class Blowfish extends BlockCipher 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 - ]; + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, - /** - * S-Box 3 - * - * @var array - */ - private static $sbox3 = [ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, @@ -428,12 +407,7 @@ protected function setupKey() /* key-expanding p[] and S-Box building sb[] */ $this->bctx = [ 'p' => [], - 'sb' => [ - self::$sbox0, - self::$sbox1, - self::$sbox2, - self::$sbox3 - ] + 'sb' => self::$sbox ]; // unpack binary string in unsigned chars @@ -459,11 +433,11 @@ protected function setupKey() $this->bctx['p'][$i ] = $l; $this->bctx['p'][$i + 1] = $r; } - for ($i = 0; $i < 4; ++$i) { + for ($i = 0; $i < 0x400; $i += 0x100) { for ($j = 0; $j < 256; $j += 2) { list($l, $r) = array_values(unpack('N*', $data = $this->encryptBlock($data))); - $this->bctx['sb'][$i][$j ] = $l; - $this->bctx['sb'][$i][$j + 1] = $r; + $this->bctx['sb'][$i | $j] = $l; + $this->bctx['sb'][$i | ($j + 1)] = $r; } } } @@ -473,11 +447,8 @@ protected function setupKey() */ protected static function initialize_static_variables() { - if (is_float(self::$sbox2[0])) { - self::$sbox0 = array_map('intval', self::$sbox0); - self::$sbox1 = array_map('intval', self::$sbox1); - self::$sbox2 = array_map('intval', self::$sbox2); - self::$sbox3 = array_map('intval', self::$sbox3); + if (is_float(self::$sbox[0x200])) { + self::$sbox = array_map('intval', self::$sbox); self::$parray = array_map('intval', self::$parray); } @@ -495,28 +466,25 @@ protected static function initialize_static_variables() private static function bcrypt_hash($sha2pass, $sha2salt) { $p = self::$parray; - $sbox0 = self::$sbox0; - $sbox1 = self::$sbox1; - $sbox2 = self::$sbox2; - $sbox3 = self::$sbox3; + $sbox = self::$sbox; $cdata = array_values(unpack('N*', 'OxychromaticBlowfishSwatDynamite')); $sha2pass = array_values(unpack('N*', $sha2pass)); $sha2salt = array_values(unpack('N*', $sha2salt)); - self::expandstate($sha2salt, $sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p); + self::expandstate($sha2salt, $sha2pass, $sbox, $p); for ($i = 0; $i < 64; $i++) { - self::expand0state($sha2salt, $sbox0, $sbox1, $sbox2, $sbox3, $p); - self::expand0state($sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p); + self::expand0state($sha2salt, $sbox, $p); + self::expand0state($sha2pass, $sbox, $p); } for ($i = 0; $i < 64; $i++) { for ($j = 0; $j < 8; $j += 2) { // count($cdata) == 8 - list($cdata[$j], $cdata[$j + 1]) = self::encryptBlockHelperFast($cdata[$j], $cdata[$j + 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); + list($cdata[$j], $cdata[$j + 1]) = self::encryptBlockHelperFast($cdata[$j], $cdata[$j + 1], $sbox, $p); } } - return pack('L*', ...$cdata); + return pack('V*', ...$cdata); } /** @@ -565,14 +533,11 @@ public static function bcrypt_pbkdf($pass, $salt, $keylen, $rounds) * * @access private * @param int[] $key - * @param int[] $sbox0 - * @param int[] $sbox1 - * @param int[] $sbox2 - * @param int[] $sbox3 + * @param int[] $sbox * @param int[] $p * @see self::_bcrypt_hash() */ - private static function expand0state(array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p) + private static function expand0state(array $key, array &$sbox, array &$p) { // expand0state is basically the same thing as this: //return self::expandstate(array_fill(0, 16, 0), $key); @@ -600,35 +565,20 @@ private static function expand0state(array $key, array &$sbox0, array &$sbox1, a ]; // @codingStandardsIgnoreStart - list( $p[0], $p[1]) = self::encryptBlockHelperFast( 0, 0, $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[2], $p[3]) = self::encryptBlockHelperFast($p[ 0], $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[4], $p[5]) = self::encryptBlockHelperFast($p[ 2], $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[6], $p[7]) = self::encryptBlockHelperFast($p[ 4], $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[8], $p[9]) = self::encryptBlockHelperFast($p[ 6], $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[10], $p[11]) = self::encryptBlockHelperFast($p[ 8], $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[12], $p[13]) = self::encryptBlockHelperFast($p[10], $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[14], $p[15]) = self::encryptBlockHelperFast($p[12], $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[16], $p[17]) = self::encryptBlockHelperFast($p[14], $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p); + list( $p[0], $p[1]) = self::encryptBlockHelperFast( 0, 0, $sbox, $p); + list( $p[2], $p[3]) = self::encryptBlockHelperFast($p[ 0], $p[ 1], $sbox, $p); + list( $p[4], $p[5]) = self::encryptBlockHelperFast($p[ 2], $p[ 3], $sbox, $p); + list( $p[6], $p[7]) = self::encryptBlockHelperFast($p[ 4], $p[ 5], $sbox, $p); + list( $p[8], $p[9]) = self::encryptBlockHelperFast($p[ 6], $p[ 7], $sbox, $p); + list($p[10], $p[11]) = self::encryptBlockHelperFast($p[ 8], $p[ 9], $sbox, $p); + list($p[12], $p[13]) = self::encryptBlockHelperFast($p[10], $p[11], $sbox, $p); + list($p[14], $p[15]) = self::encryptBlockHelperFast($p[12], $p[13], $sbox, $p); + list($p[16], $p[17]) = self::encryptBlockHelperFast($p[14], $p[15], $sbox, $p); // @codingStandardsIgnoreEnd - list($sbox0[0], $sbox0[1]) = self::encryptBlockHelperFast($p[16], $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2; $i < 256; $i += 2) { - list($sbox0[$i], $sbox0[$i + 1]) = self::encryptBlockHelperFast($sbox0[$i - 2], $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox1[0], $sbox1[1]) = self::encryptBlockHelperFast($sbox0[254], $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2; $i < 256; $i += 2) { - list($sbox1[$i], $sbox1[$i + 1]) = self::encryptBlockHelperFast($sbox1[$i - 2], $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox2[0], $sbox2[1]) = self::encryptBlockHelperFast($sbox1[254], $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2; $i < 256; $i += 2) { - list($sbox2[$i], $sbox2[$i + 1]) = self::encryptBlockHelperFast($sbox2[$i - 2], $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox3[0], $sbox3[1]) = self::encryptBlockHelperFast($sbox2[254], $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2; $i < 256; $i += 2) { - list($sbox3[$i], $sbox3[$i + 1]) = self::encryptBlockHelperFast($sbox3[$i - 2], $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); + list($sbox[0], $sbox[1]) = self::encryptBlockHelperFast($p[16], $p[17], $sbox, $p); + for ($i = 2; $i < 1024; $i += 2) { + list($sbox[$i], $sbox[$i + 1]) = self::encryptBlockHelperFast($sbox[$i - 2], $sbox[$i - 1], $sbox, $p); } } @@ -638,14 +588,11 @@ private static function expand0state(array $key, array &$sbox0, array &$sbox1, a * @access private * @param int[] $data * @param int[] $key - * @param int[] $sbox0 - * @param int[] $sbox1 - * @param int[] $sbox2 - * @param int[] $sbox3 + * @param int[] $sbox * @param int[] $p * @see self::_bcrypt_hash() */ - private static function expandstate(array $data, array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p) + private static function expandstate(array $data, array $key, array &$sbox, array &$p) { $p = [ $p[0] ^ $key[0], @@ -669,35 +616,20 @@ private static function expandstate(array $data, array $key, array &$sbox0, arra ]; // @codingStandardsIgnoreStart - list( $p[0], $p[1]) = self::encryptBlockHelperFast($data[ 0] , $data[ 1] , $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[2], $p[3]) = self::encryptBlockHelperFast($data[ 2] ^ $p[ 0], $data[ 3] ^ $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[4], $p[5]) = self::encryptBlockHelperFast($data[ 4] ^ $p[ 2], $data[ 5] ^ $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[6], $p[7]) = self::encryptBlockHelperFast($data[ 6] ^ $p[ 4], $data[ 7] ^ $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list( $p[8], $p[9]) = self::encryptBlockHelperFast($data[ 8] ^ $p[ 6], $data[ 9] ^ $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[10], $p[11]) = self::encryptBlockHelperFast($data[10] ^ $p[ 8], $data[11] ^ $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[12], $p[13]) = self::encryptBlockHelperFast($data[12] ^ $p[10], $data[13] ^ $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[14], $p[15]) = self::encryptBlockHelperFast($data[14] ^ $p[12], $data[15] ^ $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p); - list($p[16], $p[17]) = self::encryptBlockHelperFast($data[ 0] ^ $p[14], $data[ 1] ^ $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p); + list( $p[0], $p[1]) = self::encryptBlockHelperFast($data[ 0] , $data[ 1] , $sbox, $p); + list( $p[2], $p[3]) = self::encryptBlockHelperFast($data[ 2] ^ $p[ 0], $data[ 3] ^ $p[ 1], $sbox, $p); + list( $p[4], $p[5]) = self::encryptBlockHelperFast($data[ 4] ^ $p[ 2], $data[ 5] ^ $p[ 3], $sbox, $p); + list( $p[6], $p[7]) = self::encryptBlockHelperFast($data[ 6] ^ $p[ 4], $data[ 7] ^ $p[ 5], $sbox, $p); + list( $p[8], $p[9]) = self::encryptBlockHelperFast($data[ 8] ^ $p[ 6], $data[ 9] ^ $p[ 7], $sbox, $p); + list($p[10], $p[11]) = self::encryptBlockHelperFast($data[10] ^ $p[ 8], $data[11] ^ $p[ 9], $sbox, $p); + list($p[12], $p[13]) = self::encryptBlockHelperFast($data[12] ^ $p[10], $data[13] ^ $p[11], $sbox, $p); + list($p[14], $p[15]) = self::encryptBlockHelperFast($data[14] ^ $p[12], $data[15] ^ $p[13], $sbox, $p); + list($p[16], $p[17]) = self::encryptBlockHelperFast($data[ 0] ^ $p[14], $data[ 1] ^ $p[15], $sbox, $p); // @codingStandardsIgnoreEnd - list($sbox0[0], $sbox0[1]) = self::encryptBlockHelperFast($data[2] ^ $p[16], $data[3] ^ $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) { // instead of 16 maybe count($data) would be better? - list($sbox0[$i], $sbox0[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox0[$i - 2], $data[$j + 1] ^ $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox1[0], $sbox1[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox0[254], $data[3] ^ $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) { - list($sbox1[$i], $sbox1[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox1[$i - 2], $data[$j + 1] ^ $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox2[0], $sbox2[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox1[254], $data[3] ^ $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) { - list($sbox2[$i], $sbox2[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox2[$i - 2], $data[$j + 1] ^ $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); - } - - list($sbox3[0], $sbox3[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox2[254], $data[3] ^ $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p); - for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) { - list($sbox3[$i], $sbox3[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox3[$i - 2], $data[$j + 1] ^ $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p); + list($sbox[0], $sbox[1]) = self::encryptBlockHelperFast($data[2] ^ $p[16], $data[3] ^ $p[17], $sbox, $p); + for ($i = 2, $j = 4; $i < 1024; $i += 2, $j = ($j + 2) % 16) { // instead of 16 maybe count($data) would be better? + list($sbox[$i], $sbox[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox[$i - 2], $data[$j + 1] ^ $sbox[$i - 1], $sbox, $p); } } @@ -711,18 +643,15 @@ protected function encryptBlock($in) { $p = $this->bctx['p']; // extract($this->bctx['sb'], EXTR_PREFIX_ALL, 'sb'); // slower - $sb_0 = $this->bctx['sb'][0]; - $sb_1 = $this->bctx['sb'][1]; - $sb_2 = $this->bctx['sb'][2]; - $sb_3 = $this->bctx['sb'][3]; + $sb = $this->bctx['sb']; $in = unpack('N*', $in); $l = $in[1]; $r = $in[2]; list($r, $l) = PHP_INT_SIZE == 4 ? - self::encryptBlockHelperSlow($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p) : - self::encryptBlockHelperFast($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p); + self::encryptBlockHelperSlow($l, $r, $sb, $p) : + self::encryptBlockHelperFast($l, $r, $sb, $p); return pack("N*", $r, $l); } @@ -733,32 +662,29 @@ protected function encryptBlock($in) * @access private * @param int $x0 * @param int $x1 - * @param int[] $sbox0 - * @param int[] $sbox1 - * @param int[] $sbox2 - * @param int[] $sbox3 + * @param int[] $sbox * @param int[] $p * @return int[] */ - private static function encryptBlockHelperFast($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p) + private static function encryptBlockHelperFast($x0, $x1, array $sbox, array $p) { $x0 ^= $p[0]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14]; - $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15]; - $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[1]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[2]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[3]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[4]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[5]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[6]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[7]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[8]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[9]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[10]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[11]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[12]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[13]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[14]; + $x1 ^= ((($sbox[($x0 & 0xFF000000) >> 24] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[15]; + $x0 ^= ((($sbox[($x1 & 0xFF000000) >> 24] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[16]; return [$x1 & 0xFFFFFFFF ^ $p[17], $x0 & 0xFFFFFFFF]; } @@ -769,33 +695,30 @@ private static function encryptBlockHelperFast($x0, $x1, array $sbox0, array $sb * @access private * @param int $x0 * @param int $x1 - * @param int[] $sbox0 - * @param int[] $sbox1 - * @param int[] $sbox2 - * @param int[] $sbox3 + * @param int[] $sbox * @param int[] $p * @return int[] */ - private static function encryptBlockHelperSlow($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p) + private static function encryptBlockHelperSlow($x0, $x1, array $sbox, array $p) { // -16777216 == intval(0xFF000000) on 32-bit PHP installs $x0 ^= $p[0]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14]; - $x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15]; - $x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[1]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[2]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[3]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[4]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[5]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[6]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[7]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[8]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[9]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[10]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[11]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[12]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[13]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[14]; + $x1 ^= self::safe_intval((self::safe_intval($sbox[(($x0 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x0 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x0 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x0 & 0xFF)]) ^ $p[15]; + $x0 ^= self::safe_intval((self::safe_intval($sbox[(($x1 & -16777216) >> 24) & 0xFF] + $sbox[0x100 | (($x1 & 0xFF0000) >> 16)]) ^ $sbox[0x200 | (($x1 & 0xFF00) >> 8)]) + $sbox[0x300 | ($x1 & 0xFF)]) ^ $p[16]; return [$x1 ^ $p[17], $x0]; } @@ -809,10 +732,7 @@ private static function encryptBlockHelperSlow($x0, $x1, array $sbox0, array $sb protected function decryptBlock($in) { $p = $this->bctx['p']; - $sb_0 = $this->bctx['sb'][0]; - $sb_1 = $this->bctx['sb'][1]; - $sb_2 = $this->bctx['sb'][2]; - $sb_3 = $this->bctx['sb'][3]; + $sb = $this->bctx['sb']; $in = unpack('N*', $in); $l = $in[1]; @@ -820,14 +740,14 @@ protected function decryptBlock($in) for ($i = 17; $i > 2; $i -= 2) { $l ^= $p[$i]; - $r ^= self::safe_intval((self::safe_intval($sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff]) ^ - $sb_2[$l >> 8 & 0xff]) + - $sb_3[$l & 0xff]); + $r ^= self::safe_intval((self::safe_intval($sb[$l >> 24 & 0xff] + $sb[0x100 + ($l >> 16 & 0xff)]) ^ + $sb[0x200 + ($l >> 8 & 0xff)]) + + $sb[0x300 + ($l & 0xff)]); $r ^= $p[$i - 1]; - $l ^= self::safe_intval((self::safe_intval($sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff]) ^ - $sb_2[$r >> 8 & 0xff]) + - $sb_3[$r & 0xff]); + $l ^= self::safe_intval((self::safe_intval($sb[$r >> 24 & 0xff] + $sb[0x100 + ($r >> 16 & 0xff)]) ^ + $sb[0x200 + ($r >> 8 & 0xff)]) + + $sb[0x300 + ($r & 0xff)]); } return pack('N*', $r ^ $p[0], $l ^ $p[1]); } @@ -841,12 +761,9 @@ protected function setupInlineCrypt() { $p = $this->bctx['p']; $init_crypt = ' - static $sb_0, $sb_1, $sb_2, $sb_3; - if (!$sb_0) { - $sb_0 = $this->bctx["sb"][0]; - $sb_1 = $this->bctx["sb"][1]; - $sb_2 = $this->bctx["sb"][2]; - $sb_3 = $this->bctx["sb"][3]; + static $sb; + if (!$sb) { + $sb = $this->bctx["sb"]; } '; @@ -861,14 +778,14 @@ protected function setupInlineCrypt() for ($i = 0; $i < 16; $i += 2) { $encrypt_block .= ' $l^= ' . $p[$i] . '; - $r^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff]') . ' ^ - $sb_2[$l >> 8 & 0xff]) + - $sb_3[$l & 0xff]') . '; + $r^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb[$l >> 24 & 0xff] + $sb[0x100 + ($l >> 16 & 0xff)]') . ' ^ + $sb[0x200 + ($l >> 8 & 0xff)]) + + $sb[0x300 + ($l & 0xff)]') . '; $r^= ' . $p[$i + 1] . '; - $l^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff]') . ' ^ - $sb_2[$r >> 8 & 0xff]) + - $sb_3[$r & 0xff]') . '; + $l^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb[$r >> 24 & 0xff] + $sb[0x100 + ($r >> 16 & 0xff)]') . ' ^ + $sb[0x200 + ($r >> 8 & 0xff)]) + + $sb[0x300 + ($r & 0xff)]') . '; '; } $encrypt_block .= ' @@ -887,14 +804,14 @@ protected function setupInlineCrypt() for ($i = 17; $i > 2; $i -= 2) { $decrypt_block .= ' $l^= ' . $p[$i] . '; - $r^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff]') . ' ^ - $sb_2[$l >> 8 & 0xff]) + - $sb_3[$l & 0xff]') . '; + $r^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb[$l >> 24 & 0xff] + $sb[0x100 + ($l >> 16 & 0xff)]') . ' ^ + $sb[0x200 + ($l >> 8 & 0xff)]) + + $sb[0x300 + ($l & 0xff)]') . '; $r^= ' . $p[$i - 1] . '; - $l^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff]') . ' ^ - $sb_2[$r >> 8 & 0xff]) + - $sb_3[$r & 0xff]') . '; + $l^= ' . sprintf($safeint, '(' . sprintf($safeint, '$sb[$r >> 24 & 0xff] + $sb[0x100 + ($r >> 16 & 0xff)]') . ' ^ + $sb[0x200 + ($r >> 8 & 0xff)]) + + $sb[0x300 + ($r & 0xff)]') . '; '; } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php index 09eb5b1b3..a380e43d7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php @@ -30,14 +30,14 @@ abstract class AsymmetricKey /** * Precomputed Zero * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected static $zero; /** * Precomputed One * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected static $one; @@ -51,14 +51,14 @@ abstract class AsymmetricKey /** * Hash function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ protected $hash; /** * HMAC function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ private $hmac; @@ -130,7 +130,7 @@ protected static function initialize_static_variables() * * @param string $key * @param string $password optional - * @return \phpseclib3\Crypt\Common\PublicKey|\phpseclib3\Crypt\Common\PrivateKey + * @return PublicKey|PrivateKey */ public static function load($key, $password = false) { @@ -531,7 +531,7 @@ protected function computek($h1) /** * Integer to Octet String * - * @param \phpseclib3\Math\BigInteger $v + * @param BigInteger $v * @return string */ private function int2octets($v) @@ -551,7 +551,7 @@ private function int2octets($v) * Bit String to Integer * * @param string $in - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ protected function bits2int($in) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php index fe3d85bd6..ab7f05045 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php @@ -18,6 +18,7 @@ use phpseclib3\Common\Functions\Strings; use phpseclib3\Crypt\AES; use phpseclib3\Crypt\Random; +use phpseclib3\Exception\BadDecryptionException; /** * OpenSSH Formatted RSA Key Handler @@ -96,7 +97,7 @@ public static function load($key, $password = '') $crypto->setPassword($password, 'bcrypt', $salt, $rounds, 32); break; default: - throw new \RuntimeException('The only supported cipherse are: none, aes256-ctr (' . $ciphername . ' is being used)'); + throw new \RuntimeException('The only supported ciphers are: none, aes256-ctr (' . $ciphername . ' is being used)'); } list($publicKey, $paddedKey) = Strings::unpackSSH2('ss', $key); @@ -107,7 +108,10 @@ public static function load($key, $password = '') list($checkint1, $checkint2) = Strings::unpackSSH2('NN', $paddedKey); // any leftover bytes in $paddedKey are for padding? but they should be sequential bytes. eg. 1, 2, 3, etc. if ($checkint1 != $checkint2) { - throw new \RuntimeException('The two checkints do not match'); + if (isset($crypto)) { + throw new BadDecryptionException('Unable to decrypt key - please verify the password you are using'); + } + throw new \RuntimeException("The two checkints do not match ($checkint1 vs. $checkint2)"); } self::checkType($type); diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php index 7aa554808..732ac5df7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php @@ -697,7 +697,7 @@ public static function extractEncryptionAlgorithm($key) $decoded = self::preParse($key); - $r = ASN1::asn1map($decoded[0], ASN1\Maps\EncryptedPrivateKeyInfo::MAP); + $r = ASN1::asn1map($decoded[0], Maps\EncryptedPrivateKeyInfo::MAP); if (!is_array($r)) { throw new \RuntimeException('Unable to parse using EncryptedPrivateKeyInfo map'); } @@ -707,7 +707,7 @@ public static function extractEncryptionAlgorithm($key) if (!$decoded) { throw new \RuntimeException('Unable to decode BER'); } - $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], ASN1\Maps\PBES2params::MAP); + $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], Maps\PBES2params::MAP); $kdf = &$r['encryptionAlgorithm']['parameters']['keyDerivationFunc']; switch ($kdf['algorithm']) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php index ab8e7e460..42a65afa4 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php @@ -49,8 +49,8 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php index 0e2d6f0c3..0d9690822 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php @@ -35,7 +35,7 @@ abstract class StreamCipher extends SymmetricKey * Default Constructor. * * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() - * @return \phpseclib3\Crypt\Common\StreamCipher + * @return StreamCipher */ public function __construct() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php index 175508d41..35d7a7d7a 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php @@ -1079,7 +1079,7 @@ public function setPassword($password, $method = 'pbkdf2', ...$func_args) * * @see self::setPassword() * @param int $n - * @param \phpseclib3\Crypt\Hash $hashObj + * @param Hash $hashObj * @param string $i * @param string $d * @param int $count diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH.php index e1deaf086..b2301986f 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH.php @@ -49,7 +49,7 @@ abstract class DH extends AsymmetricKey /** * DH prime * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $prime; @@ -58,14 +58,14 @@ abstract class DH extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $base; /** * Public Key * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $publicKey; @@ -243,7 +243,7 @@ public static function createParameters(...$args) * * @param Parameters $params * @param int $length optional - * @return DH\PrivateKey + * @return PrivateKey */ public static function createKey(Parameters $params, $length = 0) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php index c330a3c76..7d02e5f33 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php @@ -89,10 +89,10 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $prime - * @param \phpseclib3\Math\BigInteger $base - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Math\BigInteger $publicKey + * @param BigInteger $prime + * @param BigInteger $base + * @param BigInteger $privateKey + * @param BigInteger $publicKey * @param string $password optional * @param array $options optional * @return string @@ -112,9 +112,9 @@ public static function savePrivateKey(BigInteger $prime, BigInteger $base, BigIn /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $prime - * @param \phpseclib3\Math\BigInteger $base - * @param \phpseclib3\Math\BigInteger $publicKey + * @param BigInteger $prime + * @param BigInteger $base + * @param BigInteger $publicKey * @param array $options optional * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php index 737781f87..e2407e35e 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php @@ -40,7 +40,7 @@ final class PrivateKey extends DH /** * Returns the public key * - * @return DH\PublicKey + * @return PublicKey */ public function getPublicKey() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA.php index 0123c66c5..92c777d6a 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA.php @@ -53,7 +53,7 @@ abstract class DSA extends AsymmetricKey /** * DSA Prime P * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $p; @@ -62,21 +62,21 @@ abstract class DSA extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $q; /** * DSA Group Generator G * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $g; /** * DSA public key value y * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $y; @@ -99,7 +99,7 @@ abstract class DSA extends AsymmetricKey * * @param int $L * @param int $N - * @return \phpseclib3\Crypt\DSA|bool + * @return DSA|bool */ public static function createParameters($L = 2048, $N = 224) { @@ -179,7 +179,7 @@ public static function createParameters($L = 2048, $N = 224) * Returns the private key, from which the publickey can be extracted * * @param int[] ...$args - * @return DSA\PrivateKey + * @return PrivateKey */ public static function createKey(...$args) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php index cc204fa94..bc41fcf5e 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php @@ -65,10 +65,10 @@ public static function load($key, $password = '') /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @param array $options optional * @return string */ @@ -99,11 +99,11 @@ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php index 52a049928..800cfb38c 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php @@ -77,9 +77,9 @@ public static function load($key, $password = '') /** * Convert DSA parameters to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g * @return string */ public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $g) @@ -100,11 +100,11 @@ public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $ /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -128,10 +128,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php index 004881e8c..238f42c25 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php @@ -99,11 +99,11 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -124,10 +124,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @param array $options optional * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php index 177bfdd4f..f6177f462 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php @@ -68,11 +68,11 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -92,10 +92,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php index 201aa6f95..8e2ef01f1 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php @@ -56,11 +56,11 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @return string */ @@ -72,10 +72,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php index fc3636771..f77cbf20d 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php @@ -114,10 +114,10 @@ public static function load($key, $password = '') * * See https://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php index df52beed4..f80060286 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php @@ -51,8 +51,8 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php index dbfceabba..88807b5b8 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php @@ -55,8 +55,8 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php index 74d3e69e3..87cd77a7a 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php @@ -28,7 +28,7 @@ final class PrivateKey extends DSA implements Common\PrivateKey /** * DSA secret exponent x * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $x; diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC.php index 10b38254a..dc82dd049 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC.php @@ -70,7 +70,7 @@ abstract class EC extends AsymmetricKey /** * Curve * - * @var \phpseclib3\Crypt\EC\BaseCurves\Base + * @var EC\BaseCurves\Base */ protected $curve; @@ -100,7 +100,7 @@ abstract class EC extends AsymmetricKey * * Used for deterministic ECDSA * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $q; @@ -112,7 +112,7 @@ abstract class EC extends AsymmetricKey * public key. But the x is different depending on which side of the equal sign * you're on. It's less ambiguous if you do dA * base point = (x, y)-coordinate. * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $x; @@ -134,7 +134,7 @@ abstract class EC extends AsymmetricKey * Create public / private key pair. * * @param string $curve - * @return \phpseclib3\Crypt\EC\PrivateKey + * @return PrivateKey */ public static function createKey($curve) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php index dbc914be6..d76562d0d 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php @@ -32,7 +32,7 @@ abstract class Base /** * Finite Field Integer factory * - * @var \phpseclib3\Math\FiniteField\Integer + * @var FiniteField\Integer */ protected $factory; @@ -47,7 +47,7 @@ public function randomInteger() } /** - * Converts a BigInteger to a \phpseclib3\Math\FiniteField\Integer integer + * Converts a BigInteger to a FiniteField\Integer integer * * @return object */ @@ -147,7 +147,7 @@ public function setOrder(BigInteger $order) /** * Returns the Order * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getOrder() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php index 4fc6c70c0..66da11da7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php @@ -35,7 +35,7 @@ class Binary extends Base /** * Binary Field Integer factory * - * @var \phpseclib3\Math\BinaryField + * @var BinaryField */ protected $factory; @@ -305,7 +305,7 @@ public function verifyPoint(array $p) /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php index e3fa50b33..bf02569dc 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php @@ -39,7 +39,7 @@ class Montgomery extends Base /** * Prime Field Integer factory * - * @var \phpseclib3\Math\PrimeField + * @var PrimeField */ protected $factory; diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php index 6250dfb0f..620040170 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php @@ -483,7 +483,7 @@ public function verifyPoint(array $p) /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { @@ -493,7 +493,7 @@ public function getModulo() /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getA() { @@ -503,7 +503,7 @@ public function getA() /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getB() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php index 2521a4c0e..004406acf 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php @@ -133,7 +133,7 @@ public function setBasePoint($x, $y) /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getA() { @@ -143,7 +143,7 @@ public function getA() /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getD() { @@ -171,7 +171,7 @@ public function getBasePoint() /** * Returns the affine point * - * @return \phpseclib3\Math\PrimeField\Integer[] + * @return PrimeField\Integer[] */ public function convertToAffine(array $p) { @@ -189,7 +189,7 @@ public function convertToAffine(array $p) /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php index 63402b4a8..743c07c3e 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php @@ -183,7 +183,7 @@ private static function initialize_static_variables() * If the key contains an implicit curve phpseclib needs the curve * to be explicitly provided * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve */ public static function setImplicitCurve(BaseCurve $curve) { @@ -195,7 +195,7 @@ public static function setImplicitCurve(BaseCurve $curve) * on the curve parameters * * @param array $params - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ protected static function loadCurveByParam(array $params) { @@ -269,7 +269,7 @@ protected static function loadCurveByParam(array $params) * Supports both compressed and uncompressed points * * @param string $str - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @return object[] */ public static function extractPoint($str, BaseCurve $curve) @@ -335,7 +335,7 @@ public static function extractPoint($str, BaseCurve $curve) * Encode Parameters * * @todo Maybe at some point this could be moved to __toString() for each of the curves? - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param bool $returnArray optional * @param array $options optional * @return string|false diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php index fd18a9815..5bc5184f7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php @@ -130,7 +130,7 @@ private static function getAlias(BaseCurve $curve) /** * Return the array superstructure for an EC public key * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return array */ @@ -155,7 +155,7 @@ private static function savePublicKeyHelper(BaseCurve $curve, array $publicKey) /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -170,8 +170,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $ /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php index 5741b05ad..aa64f79ab 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php @@ -71,7 +71,7 @@ public static function load($key, $password = '') /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ @@ -83,8 +83,8 @@ public static function savePublicKey(MontgomeryCurve $curve, array $publicKey) /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param BigInteger $privateKey + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php index d1ad48a5b..257c26e87 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php @@ -60,7 +60,7 @@ public static function load($key, $password = '') /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php index 2cd3e19d0..0ef116044 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php @@ -134,7 +134,7 @@ private static function getAlias(BaseCurve $curve) /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -171,8 +171,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $ /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php index 9f4b33003..756ffb957 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php @@ -162,8 +162,8 @@ public static function saveParameters(BaseCurve $curve, array $options = []) /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php index 0ec7742fc..66ec0308c 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php @@ -130,11 +130,13 @@ private static function loadEdDSA(array $key) if (isset($key['privateKey'])) { $components['curve'] = $key['privateKeyAlgorithm']['algorithm'] == 'id-Ed25519' ? new Ed25519() : new Ed448(); - - // 0x04 == octet string - // 0x20 == length (32 bytes) - if (substr($key['privateKey'], 0, 2) != "\x04\x20") { - throw new \RuntimeException('The first two bytes of the private key field should be 0x0420'); + $expected = chr(ASN1::TYPE_OCTET_STRING) . ASN1::encodeLength($components['curve']::SIZE); + if (substr($key['privateKey'], 0, 2) != $expected) { + throw new \RuntimeException( + 'The first two bytes of the ' . + $key['privateKeyAlgorithm']['algorithm'] . + ' private key field should be 0x' . bin2hex($expected) + ); } $arr = $components['curve']->extractSecret(substr($key['privateKey'], 2)); $components['dA'] = $arr['dA']; @@ -159,7 +161,7 @@ private static function loadEdDSA(array $key) /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -190,8 +192,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $ /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional @@ -208,7 +210,7 @@ public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, if ($curve instanceof TwistedEdwardsCurve) { return self::wrapPrivateKey( - "\x04\x20" . $secret, + chr(ASN1::TYPE_OCTET_STRING) . ASN1::encodeLength($curve::SIZE) . $secret, [], null, $password, diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php index 866c883fb..7e1e9170f 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php @@ -84,8 +84,8 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional @@ -121,7 +121,7 @@ public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField[] $publicKey * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php index 27d9218fb..b0cb12650 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php @@ -171,7 +171,7 @@ private static function decodeValue($value) * Extract points from an XML document * * @param \DOMXPath $xpath - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @return object[] */ private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve) @@ -199,7 +199,7 @@ private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve) * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ private static function loadCurveByParam(\DOMXPath $xpath) { @@ -279,7 +279,7 @@ private static function loadCurveByParam(\DOMXPath $xpath) * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ private static function loadCurveByParamRFC4050(\DOMXPath $xpath) { @@ -366,7 +366,7 @@ public static function disableRFC4050Syntax() /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -407,7 +407,7 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $ /** * Encode Parameters * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param string $pre * @param array $options optional * @return string|false diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php index 2be6ba59b..cce37bab4 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php @@ -81,7 +81,7 @@ public static function load($key, $password = '') /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ @@ -93,8 +93,8 @@ public static function savePublicKey(Ed25519 $curve, array $publicKey) /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php index d2a80a14f..385028b3a 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php @@ -51,8 +51,8 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php index 69139da45..c5e622a12 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php @@ -52,15 +52,17 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s + * @param string $curve + * @param int $length * @return string */ - public static function save(BigInteger $r, BigInteger $s) + public static function save(BigInteger $r, BigInteger $s, $curve, $length) { $r = $r->toBytes(); $s = $s->toBytes(); - $len = max(strlen($r), strlen($s)); - return str_pad($r, $len, "\0", STR_PAD_LEFT) . str_pad($s, $len, "\0", STR_PAD_LEFT); + $length = (int) ceil($length / 8); + return str_pad($r, $length, "\0", STR_PAD_LEFT) . str_pad($s, $length, "\0", STR_PAD_LEFT); } } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php index e06444212..698c8e4ce 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php @@ -66,8 +66,8 @@ public static function load($sig) /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @param string $curve * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php index 598869614..91253b8fd 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php @@ -159,7 +159,7 @@ public function sign($message) extract(ASN1Signature::load($signature)); - return $shortFormat == 'SSH2' ? $format::save($r, $s, $this->getCurve()) : $format::save($r, $s); + return $this->formatSignature($r, $s); } } @@ -208,7 +208,7 @@ public function sign($message) list(, $s) = $temp->divide($this->q); */ - return $shortFormat == 'SSH2' ? $format::save($r, $s, $this->getCurve()) : $format::save($r, $s); + return $this->formatSignature($r, $s); } /** @@ -253,4 +253,28 @@ public function getPublicKey() } return $key; } + + /** + * Returns a signature in the appropriate format + * + * @return string + */ + private function formatSignature(BigInteger $r, BigInteger $s) + { + $format = $this->sigFormat; + + $temp = new \ReflectionMethod($format, 'save'); + $paramCount = $temp->getNumberOfRequiredParameters(); + + // @codingStandardsIgnoreStart + switch ($paramCount) { + case 2: return $format::save($r, $s); + case 3: return $format::save($r, $s, $this->getCurve()); + case 4: return $format::save($r, $s, $this->getCurve(), $this->getLength()); + } + // @codingStandardsIgnoreEnd + + // presumably the only way you could get to this is if you were using a custom plugin + throw new UnsupportedOperationException("$format::save() has $paramCount parameters - the only valid parameter counts are 2 or 3"); + } } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Hash.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Hash.php index 0e02544eb..61aac8675 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Hash.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/Hash.php @@ -159,7 +159,7 @@ class Hash * umac cipher object * * @see self::hash() - * @var \phpseclib3\Crypt\AES + * @var AES */ private $c; diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA.php index 19dcfea3f..9cbe6bfc7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA.php @@ -10,7 +10,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -26,7 +26,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -180,7 +180,7 @@ abstract class RSA extends AsymmetricKey /** * Hash function for the Mask Generation Function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ protected $mgfHash; @@ -194,21 +194,21 @@ abstract class RSA extends AsymmetricKey /** * Modulus (ie. n) * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $modulus; /** * Modulus length * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $k; /** * Exponent (ie. e or d) * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $exponent; @@ -252,7 +252,7 @@ abstract class RSA extends AsymmetricKey /** * Public Exponent * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $publicExponent; @@ -297,7 +297,7 @@ public static function setOpenSSLConfigPath($val) * * The public key can be extracted from the private key * - * @return RSA\PrivateKey + * @return PrivateKey * @param int $bits */ public static function createKey($bits = 2048) @@ -510,7 +510,7 @@ protected function __construct() * * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}. * - * @param bool|\phpseclib3\Math\BigInteger $x + * @param bool|Math\BigInteger $x * @param int $xLen * @return bool|string */ @@ -532,7 +532,7 @@ protected function i2osp($x, $xLen) * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}. * * @param string $x - * @return \phpseclib3\Math\BigInteger + * @return Math\BigInteger */ protected function os2ip($x) { @@ -703,7 +703,7 @@ public function withHash($hash) { $new = clone $this; - // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': @@ -738,7 +738,7 @@ public function withMGFHash($hash) { $new = clone $this; - // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php index 87f543de9..6dcf1cb03 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php @@ -90,9 +90,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -124,8 +124,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php index e9a0c4f3c..b60e48ea5 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php @@ -174,9 +174,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -211,8 +211,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php index 2367810a7..ca74ea481 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php @@ -90,8 +90,8 @@ public static function load($key, $password = '') /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ @@ -112,9 +112,9 @@ public static function savePublicKey(BigInteger $n, BigInteger $e, array $option /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php index 276c6024f..76335567f 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php @@ -102,9 +102,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -142,8 +142,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php index 1eaac6ef8..53918bc0d 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php @@ -88,9 +88,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -108,8 +108,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php index ed75b9b7a..bf51bcf76 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php @@ -154,9 +154,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -177,8 +177,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php index fe35717bb..293903cef 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php @@ -85,9 +85,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -110,8 +110,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php index db7287840..55c7ccd7a 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php @@ -138,9 +138,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -173,8 +173,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return array */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php index 280048cc0..d569dea6d 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php @@ -123,9 +123,9 @@ public static function load($key, $password = '') /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -157,8 +157,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $ /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php index 37dd09a45..8c828b316 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php @@ -51,7 +51,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey /** * Private Exponent * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $privateExponent; @@ -60,7 +60,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. * - * @return bool|\phpseclib3\Math\BigInteger + * @return bool|BigInteger */ private function rsadp(BigInteger $c) { @@ -75,7 +75,7 @@ private function rsadp(BigInteger $c) * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. * - * @return bool|\phpseclib3\Math\BigInteger + * @return bool|BigInteger */ private function rsasp1(BigInteger $m) { @@ -88,8 +88,8 @@ private function rsasp1(BigInteger $m) /** * Exponentiate * - * @param \phpseclib3\Math\BigInteger $x - * @return \phpseclib3\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ protected function exponentiate(BigInteger $x) { @@ -169,10 +169,10 @@ protected function exponentiate(BigInteger $x) * Protects against timing attacks by employing RSA Blinding. * Returns $x->modPow($this->exponents[$i], $this->primes[$i]) * - * @param \phpseclib3\Math\BigInteger $x - * @param \phpseclib3\Math\BigInteger $r + * @param BigInteger $x + * @param BigInteger $r * @param int $i - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ private function blind(BigInteger $x, BigInteger $r, $i) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php index 58939a9f6..ff80ae79c 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php @@ -35,8 +35,8 @@ final class PublicKey extends RSA implements Common\PublicKey /** * Exponentiate * - * @param \phpseclib3\Math\BigInteger $x - * @return \phpseclib3\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ private function exponentiate(BigInteger $x) { @@ -48,8 +48,8 @@ private function exponentiate(BigInteger $x) * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}. * - * @param \phpseclib3\Math\BigInteger $s - * @return bool|\phpseclib3\Math\BigInteger + * @param BigInteger $s + * @return bool|BigInteger */ private function rsavp1($s) { @@ -405,8 +405,8 @@ private function rsaes_oaep_encrypt($m) * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}. * - * @param \phpseclib3\Math\BigInteger $m - * @return bool|\phpseclib3\Math\BigInteger + * @param BigInteger $m + * @return bool|BigInteger */ private function rsaep($m) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Exception/InvalidPacketLengthException.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Exception/InvalidPacketLengthException.php new file mode 100644 index 000000000..b96ead1e3 --- /dev/null +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Exception/InvalidPacketLengthException.php @@ -0,0 +1,10 @@ +value = clone $x; - } elseif ($x instanceof BigInteger\Engines\Engine) { + } elseif ($x instanceof Engine) { $this->value = new static("$x"); $this->value->setPrecision($x->getPrecision()); } else { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php index 7c5ca9fb3..e3a49906b 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -336,7 +336,7 @@ public function bitwise_and(BCMath $x) */ public function bitwise_or(BCMath $x) { - return $this->bitwiseXorHelper($x); + return $this->bitwiseOrHelper($x); } /** diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php index 0fb7eaeba..ec1d5caa7 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php @@ -66,7 +66,7 @@ protected static function reduce($n, $m) $m_length = strlen($m); - if (strlen($n) > 2 * $m_length) { + if (strlen($n) >= 2 * $m_length) { return bcmod($n, $m); } diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php index 3518d76f3..849374193 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php @@ -56,7 +56,7 @@ protected static function reduce(array $n, array $m, $class) $m_length = count($m); // if (self::compareHelper($n, $static::square($m)) >= 0) { - if (count($n) > 2 * $m_length) { + if (count($n) >= 2 * $m_length) { $lhs = new $class(); $rhs = new $class(); $lhs->value = $n; diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php index 2f9433172..2cf69f2e8 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php @@ -100,7 +100,7 @@ protected static function generateCustomReduction(PHP $m, $class) $cutoff = count($m) + (count($m) >> 1); $code = ' - if (count($n) > ' . (2 * count($m)) . ') { + if (count($n) >= ' . (2 * count($m)) . ') { $lhs = new ' . $class . '(); $rhs = new ' . $class . '(); $lhs->value = $n; diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SFTP.php index 144ef7950..caf2a0a31 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SFTP.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SFTP.php @@ -705,7 +705,8 @@ private function init_sftp_connection() throw $e; } $this->canonicalize_paths = false; - $this->reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST); + $this->reset_sftp(); + return $this->init_sftp_connection(); } $this->update_stat_cache($this->pwd, []); @@ -2100,7 +2101,7 @@ public function rmdir($dir) * @param callable|null $progressCallback * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \BadFunctionCallException if you're uploading via a callback and the callback function is invalid - * @throws \phpseclib3\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist + * @throws FileNotFoundException if you're uploading via a file and the file doesn't exist * @return bool */ public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null) @@ -3268,6 +3269,7 @@ private function send_sftp_packet($type, $data, $request_id = 1) // in SSH2.php the timeout is cumulative per function call. eg. exec() will // timeout after 10s. but for SFTP.php it's cumulative per packet $this->curTimeout = $this->timeout; + $this->is_timeout = false; $packet = $this->use_request_id ? pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) : @@ -3285,19 +3287,25 @@ private function send_sftp_packet($type, $data, $request_id = 1) } /** - * Resets a connection for re-use - * - * @param int $reason + * Resets the SFTP channel for re-use */ - protected function reset_connection($reason) + private function reset_sftp() { - parent::reset_connection($reason); $this->use_request_id = false; $this->pwd = false; $this->requestBuffer = []; $this->partial_init = false; } + /** + * Resets a connection for re-use + */ + protected function reset_connection() + { + parent::reset_connection(); + $this->reset_sftp(); + } + /** * Receives SFTP Packets * @@ -3324,6 +3332,7 @@ private function get_sftp_packet($request_id = null) // in SSH2.php the timeout is cumulative per function call. eg. exec() will // timeout after 10s. but for SFTP.php it's cumulative per packet $this->curTimeout = $this->timeout; + $this->is_timeout = false; $start = microtime(true); diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SSH2.php index eee2e108d..ede874331 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SSH2.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/Net/SSH2.php @@ -64,7 +64,9 @@ use phpseclib3\Crypt\Twofish; use phpseclib3\Exception\ConnectionClosedException; use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Exception\InvalidPacketLengthException; use phpseclib3\Exception\NoSupportedAlgorithmsException; +use phpseclib3\Exception\TimeoutException; use phpseclib3\Exception\UnableToConnectException; use phpseclib3\Exception\UnsupportedAlgorithmException; use phpseclib3\Exception\UnsupportedCurveException; @@ -102,7 +104,6 @@ class SSH2 const MASK_LOGIN_REQ = 0x00000004; const MASK_LOGIN = 0x00000008; const MASK_SHELL = 0x00000010; - const MASK_WINDOW_ADJUST = 0x00000020; /* * Channel constants @@ -625,7 +626,7 @@ class SSH2 protected $server_channels = []; /** - * Channel Buffers + * Channel Read Buffers * * If a client requests a packet from one channel but receives two packets from another those packets should * be placed in a buffer @@ -636,6 +637,17 @@ class SSH2 */ private $channel_buffers = []; + /** + * Channel Write Buffers + * + * If a client sends a packet and receives a timeout error mid-transmission, buffer the data written so it + * can be de-duplicated upon resuming write + * + * @see self::send_channel_packet() + * @var array + */ + private $channel_buffers_write = []; + /** * Channel Status * @@ -824,11 +836,11 @@ class SSH2 private $quiet_mode = false; /** - * Time of first network activity + * Time of last read/write network activity * * @var float */ - private $last_packet; + private $last_packet = null; /** * Exit status returned from ssh if any @@ -886,7 +898,7 @@ class SSH2 * @see self::isTimeout() * @var bool */ - private $is_timeout = false; + protected $is_timeout = false; /** * Log Boundary @@ -1000,14 +1012,14 @@ class SSH2 * * @var bool */ - private $retry_connect = false; + private $login_credentials_finalized = false; /** * Binary Packet Buffer * - * @var string|false + * @var object|null */ - private $binary_packet_buffer = false; + private $binary_packet_buffer = null; /** * Preferred Signature Format @@ -1456,13 +1468,7 @@ private function connect() } if (!$this->send_kex_first) { - $response = $this->get_binary_packet(); - - if (is_bool($response) || !strlen($response) || ord($response[0]) != NET_SSH2_MSG_KEXINIT) { - $this->bitmap = 0; - throw new \UnexpectedValueException('Expected SSH_MSG_KEXINIT'); - } - + $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_KEXINIT); $this->key_exchange($response); } @@ -1517,7 +1523,7 @@ private function generate_identifier() * @param string|bool $kexinit_payload_server optional * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \RuntimeException on other errors - * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible + * @throws NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible */ private function key_exchange($kexinit_payload_server = false) { @@ -1606,17 +1612,7 @@ private function key_exchange($kexinit_payload_server = false) $this->send_binary_packet($kexinit_payload_client); $this->extra_packets = 0; - $kexinit_payload_server = $this->get_binary_packet(); - - if ( - is_bool($kexinit_payload_server) - || !strlen($kexinit_payload_server) - || ord($kexinit_payload_server[0]) != NET_SSH2_MSG_KEXINIT - ) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); - throw new \UnexpectedValueException('Expected SSH_MSG_KEXINIT'); - } - + $kexinit_payload_server = $this->get_binary_packet_or_close(NET_SSH2_MSG_KEXINIT); $send_kex = false; } @@ -1654,15 +1650,13 @@ private function key_exchange($kexinit_payload_server = false) // we don't initialize any crypto-objects, yet - we do that, later. for now, we need the lengths to make the // diffie-hellman key exchange as fast as possible $decrypt = self::array_intersect_first($s2c_encryption_algorithms, $this->encryption_algorithms_server_to_client); - $decryptKeyLength = $this->encryption_algorithm_to_key_size($decrypt); - if ($decryptKeyLength === null) { + if (!$decrypt || ($decryptKeyLength = $this->encryption_algorithm_to_key_size($decrypt)) === null) { $this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED); throw new NoSupportedAlgorithmsException('No compatible server to client encryption algorithms found'); } $encrypt = self::array_intersect_first($c2s_encryption_algorithms, $this->encryption_algorithms_client_to_server); - $encryptKeyLength = $this->encryption_algorithm_to_key_size($encrypt); - if ($encryptKeyLength === null) { + if (!$encrypt || ($encryptKeyLength = $this->encryption_algorithm_to_key_size($encrypt)) === null) { $this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED); throw new NoSupportedAlgorithmsException('No compatible client to server encryption algorithms found'); } @@ -1762,13 +1756,8 @@ private function key_exchange($kexinit_payload_server = false) $this->send_binary_packet($packet); $this->updateLogHistory('UNKNOWN (34)', 'NET_SSH2_MSG_KEXDH_GEX_REQUEST'); - $response = $this->get_binary_packet(); - + $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_KEXDH_GEX_GROUP); list($type, $primeBytes, $gBytes) = Strings::unpackSSH2('Css', $response); - if ($type != NET_SSH2_MSG_KEXDH_GEX_GROUP) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); - throw new \UnexpectedValueException('Expected SSH_MSG_KEX_DH_GEX_GROUP'); - } $this->updateLogHistory('NET_SSH2_MSG_KEXDH_REPLY', 'NET_SSH2_MSG_KEXDH_GEX_GROUP'); $prime = new BigInteger($primeBytes, -256); $g = new BigInteger($gBytes, -256); @@ -1807,7 +1796,7 @@ private function key_exchange($kexinit_payload_server = false) $this->updateLogHistory('UNKNOWN (32)', 'NET_SSH2_MSG_KEXDH_GEX_INIT'); } - $response = $this->get_binary_packet(); + $response = $this->get_binary_packet_or_close(constant($serverKexReplyMessage)); list( $type, @@ -1816,10 +1805,6 @@ private function key_exchange($kexinit_payload_server = false) $this->signature ) = Strings::unpackSSH2('Csss', $response); - if ($type != constant($serverKexReplyMessage)) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); - throw new \UnexpectedValueException("Expected $serverKexReplyMessage"); - } switch ($serverKexReplyMessage) { case 'NET_SSH2_MSG_KEX_ECDH_REPLY': $this->updateLogHistory('NET_SSH2_MSG_KEXDH_REPLY', 'NET_SSH2_MSG_KEX_ECDH_REPLY'); @@ -1886,19 +1871,7 @@ private function key_exchange($kexinit_payload_server = false) $packet = pack('C', NET_SSH2_MSG_NEWKEYS); $this->send_binary_packet($packet); - - $response = $this->get_binary_packet(); - - if ($response === false) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); - throw new ConnectionClosedException('Connection closed by server'); - } - - list($type) = Strings::unpackSSH2('C', $response); - if ($type != NET_SSH2_MSG_NEWKEYS) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); - throw new \UnexpectedValueException('Expected SSH_MSG_NEWKEYS'); - } + $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_NEWKEYS); if (in_array('kex-strict-s-v00@openssh.com', $this->kex_algorithms)) { $this->get_seq_no = $this->send_seq_no = 0; @@ -2184,7 +2157,7 @@ private static function mac_algorithm_to_hash_instance($algorithm) } } - /* + /** * Tests whether or not proposed algorithm has a potential for issues * * @link https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/ssh2-aesctr-openssh.html @@ -2216,7 +2189,7 @@ private static function bad_algorithm_candidate($algorithm) */ public function login($username, ...$args) { - if (!$this->retry_connect) { + if (!$this->login_credentials_finalized) { $this->auth[] = func_get_args(); } @@ -2319,6 +2292,7 @@ protected function sublogin($username, ...$args) foreach ($newargs as $arg) { if ($this->login_helper($username, $arg)) { + $this->login_credentials_finalized = true; return true; } } @@ -2349,35 +2323,23 @@ private function login_helper($username, $password = null) $this->send_binary_packet($packet); try { - $response = $this->get_binary_packet(); - } catch (\Exception $e) { - if ($this->retry_connect) { - $this->retry_connect = false; - $this->connect(); - return $this->login_helper($username, $password); + $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_SERVICE_ACCEPT); + } catch (InvalidPacketLengthException $e) { + // the first opportunity to encounter the "bad key size" error + if (!$this->bad_key_size_fix && $this->decryptName != null && self::bad_algorithm_candidate($this->decryptName)) { + // bad_key_size_fix is only ever re-assigned to true here + // retry the connection with that new setting but we'll + // only try it once. + $this->bad_key_size_fix = true; + return $this->reconnect(); } - $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); throw $e; } list($type) = Strings::unpackSSH2('C', $response); - - if ($type == NET_SSH2_MSG_EXT_INFO) { - list($nr_extensions) = Strings::unpackSSH2('N', $response); - for ($i = 0; $i < $nr_extensions; $i++) { - list($extension_name, $extension_value) = Strings::unpackSSH2('ss', $response); - if ($extension_name == 'server-sig-algs') { - $this->supported_private_key_algorithms = explode(',', $extension_value); - } - } - - $response = $this->get_binary_packet(); - list($type) = Strings::unpackSSH2('C', $response); - } - list($service) = Strings::unpackSSH2('s', $response); - if ($type != NET_SSH2_MSG_SERVICE_ACCEPT || $service != 'ssh-userauth') { + if ($service != 'ssh-userauth') { $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); throw new \UnexpectedValueException('Expected SSH_MSG_SERVICE_ACCEPT'); } @@ -2415,7 +2377,7 @@ private function login_helper($username, $password = null) $this->send_binary_packet($packet); - $response = $this->get_binary_packet(); + $response = $this->get_binary_packet_or_close(); list($type) = Strings::unpackSSH2('C', $response); switch ($type) { @@ -2458,10 +2420,7 @@ private function login_helper($username, $password = null) $this->send_binary_packet($packet, $logged); - $response = $this->get_binary_packet(); - if ($response === false) { - return false; - } + $response = $this->get_binary_packet_or_close(); list($type) = Strings::unpackSSH2('C', $response); switch ($type) { case NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ: // in theory, the password can be changed @@ -2529,7 +2488,7 @@ private function keyboard_interactive_process(...$responses) if (strlen($this->last_interactive_response)) { $response = $this->last_interactive_response; } else { - $orig = $response = $this->get_binary_packet(); + $orig = $response = $this->get_binary_packet_or_close(); } list($type) = Strings::unpackSSH2('C', $response); @@ -2617,17 +2576,19 @@ private function keyboard_interactive_process(...$responses) * Login with an ssh-agent provided key * * @param string $username - * @param \phpseclib3\System\SSH\Agent $agent + * @param Agent $agent * @return bool */ private function ssh_agent_login($username, Agent $agent) { $this->agent = $agent; $keys = $agent->requestIdentities(); + $orig_algorithms = $this->supported_private_key_algorithms; foreach ($keys as $key) { if ($this->privatekey_login($username, $key)) { return true; } + $this->supported_private_key_algorithms = $orig_algorithms; } return false; @@ -2640,7 +2601,7 @@ private function ssh_agent_login($username, Agent $agent) * by sending dummy SSH_MSG_IGNORE messages.} * * @param string $username - * @param \phpseclib3\Crypt\Common\PrivateKey $privatekey + * @param PrivateKey $privatekey * @return bool * @throws \RuntimeException on connection error */ @@ -2717,7 +2678,11 @@ private function privatekey_login($username, PrivateKey $privatekey) $packet = $part1 . chr(0) . $part2; $this->send_binary_packet($packet); - $response = $this->get_binary_packet(); + $response = $this->get_binary_packet_or_close( + NET_SSH2_MSG_USERAUTH_SUCCESS, + NET_SSH2_MSG_USERAUTH_FAILURE, + NET_SSH2_MSG_USERAUTH_PK_OK + ); list($type) = Strings::unpackSSH2('C', $response); switch ($type) { @@ -2738,9 +2703,6 @@ private function privatekey_login($username, PrivateKey $privatekey) case NET_SSH2_MSG_USERAUTH_SUCCESS: $this->bitmap |= self::MASK_LOGIN; return true; - default: - $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); - throw new ConnectionClosedException('Unexpected response to publickey authentication pt 1'); } $packet = $part1 . chr(1) . $part2; @@ -2753,7 +2715,10 @@ private function privatekey_login($username, PrivateKey $privatekey) $this->send_binary_packet($packet); - $response = $this->get_binary_packet(); + $response = $this->get_binary_packet_or_close( + NET_SSH2_MSG_USERAUTH_SUCCESS, + NET_SSH2_MSG_USERAUTH_FAILURE + ); list($type) = Strings::unpackSSH2('C', $response); switch ($type) { @@ -2766,9 +2731,6 @@ private function privatekey_login($username, PrivateKey $privatekey) $this->bitmap |= self::MASK_LOGIN; return true; } - - $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); - throw new ConnectionClosedException('Unexpected response to publickey authentication pt 2'); } /** @@ -2785,7 +2747,7 @@ public function getTimeout() * Set Timeout * * $ssh->exec('ping 127.0.0.1'); on a Linux host will never return and will run indefinitely. setTimeout() makes it so it'll timeout. - * Setting $timeout to false or 0 will mean there is no timeout. + * Setting $timeout to false or 0 will revert to the default socket timeout. * * @param mixed $timeout */ @@ -3205,6 +3167,7 @@ public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null) * @return void * @throws \RuntimeException on connection error * @throws InsufficientSetupException on unexpected channel status, possibly due to closure + * @throws TimeoutException if the write could not be completed within the requested self::setTimeout() */ public function write($cmd, $channel = null) { @@ -3224,6 +3187,8 @@ public function write($cmd, $channel = null) } } + $this->curTimeout = $this->timeout; + $this->is_timeout = false; $this->send_channel_packet($channel, $cmd); } @@ -3464,8 +3429,7 @@ public function ping() */ private function reconnect() { - $this->reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST); - $this->retry_connect = true; + $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); $this->connect(); foreach ($this->auth as $auth) { $result = $this->login(...$auth); @@ -3475,21 +3439,71 @@ private function reconnect() /** * Resets a connection for re-use - * - * @param int $reason */ - protected function reset_connection($reason) + protected function reset_connection() { - $this->disconnect_helper($reason); + if (is_resource($this->fsock) && get_resource_type($this->fsock) === 'stream') { + fclose($this->fsock); + } + $this->fsock = null; + $this->bitmap = 0; + $this->binary_packet_buffer = null; $this->decrypt = $this->encrypt = false; $this->decrypt_block_size = $this->encrypt_block_size = 8; $this->hmac_check = $this->hmac_create = false; $this->hmac_size = false; $this->session_id = false; - $this->retry_connect = true; + $this->last_packet = null; $this->get_seq_no = $this->send_seq_no = 0; $this->channel_status = []; $this->channel_id_last_interactive = 0; + $this->channel_buffers = []; + $this->channel_buffers_write = []; + } + + /** + * @return int[] second and microsecond stream timeout options based on user-requested timeout and keep-alive, or the default socket timeout by default, which mirrors PHP socket streams. + */ + private function get_stream_timeout() + { + $sec = ini_get('default_socket_timeout'); + $usec = 0; + if ($this->curTimeout > 0) { + $sec = (int) floor($this->curTimeout); + $usec = (int) (1000000 * ($this->curTimeout - $sec)); + } + if ($this->keepAlive > 0) { + $elapsed = microtime(true) - $this->last_packet; + $timeout = max($this->keepAlive - $elapsed, 0); + if (!$this->curTimeout || $timeout < $this->curTimeout) { + $sec = (int) floor($timeout); + $usec = (int) (1000000 * ($timeout - $sec)); + } + } + return [$sec, $usec]; + } + + /** + * Retrieves the next packet with added timeout and type handling + * + * @param string $message_types Message types to enforce in response, closing if not met + * @return string + * @throws ConnectionClosedException If an error has occurred preventing read of the next packet + */ + private function get_binary_packet_or_close(...$message_types) + { + try { + $packet = $this->get_binary_packet(); + if (count($message_types) > 0 && !in_array(ord($packet[0]), $message_types)) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); + throw new ConnectionClosedException('Bad message type. Expected: #' + . implode(', #', $message_types) . '. Got: #' . ord($packet[0])); + } + return $packet; + } catch (TimeoutException $e) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); + throw new ConnectionClosedException('Connection closed due to timeout'); + } } /** @@ -3498,81 +3512,70 @@ protected function reset_connection($reason) * See '6. Binary Packet Protocol' of rfc4253 for more info. * * @see self::_send_binary_packet() - * @param bool $skip_channel_filter - * @return bool|string + * @return string + * @throws TimeoutException If user requested timeout was reached while waiting for next packet + * @throws ConnectionClosedException If an error has occurred preventing read of the next packet */ - private function get_binary_packet($skip_channel_filter = false) + private function get_binary_packet() { - if ($skip_channel_filter) { - if (!is_resource($this->fsock)) { - throw new \InvalidArgumentException('fsock is not a resource.'); + if (!is_resource($this->fsock)) { + throw new \InvalidArgumentException('fsock is not a resource.'); + } + if ($this->binary_packet_buffer == null) { + // buffer the packet to permit continued reads across timeouts + $this->binary_packet_buffer = (object) [ + 'read_time' => 0, // the time to read the packet from the socket + 'raw' => '', // the raw payload read from the socket + 'plain' => '', // the packet in plain text, excluding packet_length header + 'packet_length' => null, // the packet_length value pulled from the payload + 'size' => $this->decrypt_block_size, // the total size of this packet to be read from the socket + // initialize to read single block until packet_length is available + ]; + } + $packet = $this->binary_packet_buffer; + while (strlen($packet->raw) < $packet->size) { + if (feof($this->fsock)) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); + throw new ConnectionClosedException('Connection closed by server'); } - $read = [$this->fsock]; - $write = $except = null; - - if (!$this->curTimeout) { - if ($this->keepAlive <= 0) { - static::stream_select($read, $write, $except, null); - } else { - if (!static::stream_select($read, $write, $except, $this->keepAlive)) { - $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); - return $this->get_binary_packet(true); - } - } - } else { - if ($this->curTimeout < 0) { - $this->is_timeout = true; - return true; - } - - $start = microtime(true); - - if ($this->keepAlive > 0 && $this->keepAlive < $this->curTimeout) { - if (!static::stream_select($read, $write, $except, $this->keepAlive)) { - $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); - $elapsed = microtime(true) - $start; - $this->curTimeout -= $elapsed; - return $this->get_binary_packet(true); - } - $elapsed = microtime(true) - $start; - $this->curTimeout -= $elapsed; - } - - $sec = (int) floor($this->curTimeout); - $usec = (int) (1000000 * ($this->curTimeout - $sec)); + if ($this->curTimeout < 0) { + $this->is_timeout = true; + throw new TimeoutException('Timed out waiting for server'); + } + $this->send_keep_alive(); - // this can return a "stream_select(): unable to select [4]: Interrupted system call" error - if (!static::stream_select($read, $write, $except, $sec, $usec)) { - $this->is_timeout = true; - return true; - } - $elapsed = microtime(true) - $start; + list($sec, $usec) = $this->get_stream_timeout(); + stream_set_timeout($this->fsock, $sec, $usec); + $start = microtime(true); + $raw = stream_get_contents($this->fsock, $packet->size - strlen($packet->raw)); + $elapsed = microtime(true) - $start; + $packet->read_time += $elapsed; + if ($this->curTimeout > 0) { $this->curTimeout -= $elapsed; } - } - - if (!is_resource($this->fsock) || feof($this->fsock)) { - $this->bitmap = 0; - $str = 'Connection closed (by server) prematurely'; - if (isset($elapsed)) { - $str .= ' ' . $elapsed . 's'; + if ($raw === false) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); + throw new ConnectionClosedException('Connection closed by server'); + } elseif (!strlen($raw)) { + continue; + } + $packet->raw .= $raw; + if (!$packet->packet_length) { + $this->get_binary_packet_size($packet); } - throw new ConnectionClosedException($str); } - $start = microtime(true); - if ($this->curTimeout) { - $sec = (int) floor($this->curTimeout); - $usec = (int) (1000000 * ($this->curTimeout - $sec)); - stream_set_timeout($this->fsock, $sec, $usec); + if (strlen($packet->raw) != $packet->size) { + throw new \RuntimeException('Size of packet was not expected length'); } - $raw = stream_get_contents($this->fsock, $this->decrypt_block_size); - - if (!strlen($raw)) { - $this->bitmap = 0; - throw new ConnectionClosedException('No data received from server'); + // destroy buffer as packet represents the entire payload and should be processed in full + $this->binary_packet_buffer = null; + // copy the raw payload, so as not to destroy original + $raw = $packet->raw; + if ($this->hmac_check instanceof Hash) { + $hmac = Strings::pop($raw, $this->hmac_size); } - + $packet_length_header_size = 4; if ($this->decrypt) { switch ($this->decryptName) { case 'aes128-gcm@openssh.com': @@ -3582,40 +3585,16 @@ private function get_binary_packet($skip_channel_filter = false) $this->decryptInvocationCounter ); Strings::increment_str($this->decryptInvocationCounter); - $this->decrypt->setAAD($temp = Strings::shift($raw, 4)); - extract(unpack('Npacket_length', $temp)); - /** - * @var integer $packet_length - */ - - $raw .= $this->read_remaining_bytes($packet_length - $this->decrypt_block_size + 4); - $stop = microtime(true); - $tag = stream_get_contents($this->fsock, $this->decrypt_block_size); - $this->decrypt->setTag($tag); - $raw = $this->decrypt->decrypt($raw); - $raw = $temp . $raw; - $remaining_length = 0; + $this->decrypt->setAAD(Strings::shift($raw, $packet_length_header_size)); + $this->decrypt->setTag(Strings::pop($raw, $this->decrypt_block_size)); + $packet->plain = $this->decrypt->decrypt($raw); break; case 'chacha20-poly1305@openssh.com': // This should be impossible, but we are checking anyway to narrow the type for Psalm. if (!($this->decrypt instanceof ChaCha20)) { throw new \LogicException('$this->decrypt is not a ' . ChaCha20::class); } - - $nonce = pack('N2', 0, $this->get_seq_no); - - $this->lengthDecrypt->setNonce($nonce); - $temp = $this->lengthDecrypt->decrypt($aad = Strings::shift($raw, 4)); - extract(unpack('Npacket_length', $temp)); - /** - * @var integer $packet_length - */ - - $raw .= $this->read_remaining_bytes($packet_length - $this->decrypt_block_size + 4); - $stop = microtime(true); - $tag = stream_get_contents($this->fsock, 16); - - $this->decrypt->setNonce($nonce); + $this->decrypt->setNonce(pack('N2', 0, $this->get_seq_no)); $this->decrypt->setCounter(0); // this is the same approach that's implemented in Salsa20::createPoly1305Key() // but we don't want to use the same AEAD construction that RFC8439 describes @@ -3623,79 +3602,55 @@ private function get_binary_packet($skip_channel_filter = false) $this->decrypt->setPoly1305Key( $this->decrypt->encrypt(str_repeat("\0", 32)) ); - $this->decrypt->setAAD($aad); + $this->decrypt->setAAD(Strings::shift($raw, $packet_length_header_size)); $this->decrypt->setCounter(1); - $this->decrypt->setTag($tag); - $raw = $this->decrypt->decrypt($raw); - $raw = $temp . $raw; - $remaining_length = 0; + $this->decrypt->setTag(Strings::pop($raw, 16)); + $packet->plain = $this->decrypt->decrypt($raw); break; default: if (!$this->hmac_check instanceof Hash || !$this->hmac_check_etm) { - $raw = $this->decrypt->decrypt($raw); - break; + // first block was already decrypted for contained packet_length header + Strings::shift($raw, $this->decrypt_block_size); + if (strlen($raw) > 0) { + $packet->plain .= $this->decrypt->decrypt($raw); + } + } else { + Strings::shift($raw, $packet_length_header_size); + $packet->plain = $this->decrypt->decrypt($raw); } - extract(unpack('Npacket_length', $temp = Strings::shift($raw, 4))); - /** - * @var integer $packet_length - */ - $raw .= $this->read_remaining_bytes($packet_length - $this->decrypt_block_size + 4); - $stop = microtime(true); - $encrypted = $temp . $raw; - $raw = $temp . $this->decrypt->decrypt($raw); - $remaining_length = 0; + break; } + } else { + Strings::shift($raw, $packet_length_header_size); + $packet->plain = $raw; } - - if (strlen($raw) < 5) { - $this->bitmap = 0; - throw new \RuntimeException('Plaintext is too short'); - } - extract(unpack('Npacket_length/Cpadding_length', Strings::shift($raw, 5))); - /** - * @var integer $packet_length - * @var integer $padding_length - */ - - if (!isset($remaining_length)) { - $remaining_length = $packet_length + 4 - $this->decrypt_block_size; - } - - $buffer = $this->read_remaining_bytes($remaining_length); - - if (!isset($stop)) { - $stop = microtime(true); - } - if (strlen($buffer)) { - $raw .= $this->decrypt ? $this->decrypt->decrypt($buffer) : $buffer; - } - - $payload = Strings::shift($raw, $packet_length - $padding_length - 1); - $padding = Strings::shift($raw, $padding_length); // should leave $raw empty - if ($this->hmac_check instanceof Hash) { - $hmac = stream_get_contents($this->fsock, $this->hmac_size); - if ($hmac === false || strlen($hmac) != $this->hmac_size) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_MAC_ERROR); - throw new \RuntimeException('Error reading socket'); - } - $reconstructed = !$this->hmac_check_etm ? - pack('NCa*', $packet_length, $padding_length, $payload . $padding) : - $encrypted; + pack('Na*', $packet->packet_length, $packet->plain) : + substr($packet->raw, 0, -$this->hmac_size); if (($this->hmac_check->getHash() & "\xFF\xFF\xFF\xFF") == 'umac') { $this->hmac_check->setNonce("\0\0\0\0" . pack('N', $this->get_seq_no)); if ($hmac != $this->hmac_check->hash($reconstructed)) { $this->disconnect_helper(NET_SSH2_DISCONNECT_MAC_ERROR); - throw new \RuntimeException('Invalid UMAC'); + throw new ConnectionClosedException('Invalid UMAC'); } } else { if ($hmac != $this->hmac_check->hash(pack('Na*', $this->get_seq_no, $reconstructed))) { $this->disconnect_helper(NET_SSH2_DISCONNECT_MAC_ERROR); - throw new \RuntimeException('Invalid HMAC'); + throw new ConnectionClosedException('Invalid HMAC'); } } } + $padding_length = 0; + $payload = $packet->plain; + extract(unpack('Cpadding_length', Strings::shift($payload, 1))); + if ($padding_length > 0) { + Strings::pop($payload, $padding_length); + } + if (empty($payload)) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); + throw new ConnectionClosedException('Plaintext is too short'); + } switch ($this->decompress) { case self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH: @@ -3740,68 +3695,74 @@ private function get_binary_packet($skip_channel_filter = false) $current = microtime(true); $message_number = isset(self::$message_numbers[ord($payload[0])]) ? self::$message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')'; $message_number = '<- ' . $message_number . - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($packet->read_time, 4) . 's)'; $this->append_log($message_number, $payload); - $this->last_packet = $current; } + $this->last_packet = microtime(true); - return $this->filter($payload, $skip_channel_filter); + return $this->filter($payload); } /** - * Read Remaining Bytes - * - * @see self::get_binary_packet() - * @param int $remaining_length - * @return string + * @param object $packet The packet object being constructed, passed by reference + * The size, packet_length, and plain properties of this object may be modified in processing + * @throws InvalidPacketLengthException if the packet length header is invalid */ - private function read_remaining_bytes($remaining_length) + private function get_binary_packet_size(&$packet) { - if (!$remaining_length) { - return ''; + $packet_length_header_size = 4; + if (strlen($packet->raw) < $packet_length_header_size) { + return; } - - $adjustLength = false; + $packet_length = 0; + $added_validation_length = 0; // indicates when the packet length header is included when validating packet length against block size if ($this->decrypt) { - switch (true) { - case $this->decryptName == 'aes128-gcm@openssh.com': - case $this->decryptName == 'aes256-gcm@openssh.com': - case $this->decryptName == 'chacha20-poly1305@openssh.com': - case $this->hmac_check instanceof Hash && $this->hmac_check_etm: - $remaining_length += $this->decrypt_block_size - 4; - $adjustLength = true; + switch ($this->decryptName) { + case 'aes128-gcm@openssh.com': + case 'aes256-gcm@openssh.com': + extract(unpack('Npacket_length', substr($packet->raw, 0, $packet_length_header_size))); + $packet->size = $packet_length_header_size + $packet_length + $this->decrypt_block_size; // expect tag + break; + case 'chacha20-poly1305@openssh.com': + $this->lengthDecrypt->setNonce(pack('N2', 0, $this->get_seq_no)); + $packet_length_header = $this->lengthDecrypt->decrypt(substr($packet->raw, 0, $packet_length_header_size)); + extract(unpack('Npacket_length', $packet_length_header)); + $packet->size = $packet_length_header_size + $packet_length + 16; // expect tag + break; + default: + if (!$this->hmac_check instanceof Hash || !$this->hmac_check_etm) { + if (strlen($packet->raw) < $this->decrypt_block_size) { + return; + } + $packet->plain = $this->decrypt->decrypt(substr($packet->raw, 0, $this->decrypt_block_size)); + extract(unpack('Npacket_length', Strings::shift($packet->plain, $packet_length_header_size))); + $packet->size = $packet_length_header_size + $packet_length; + $added_validation_length = $packet_length_header_size; + } else { + extract(unpack('Npacket_length', substr($packet->raw, 0, $packet_length_header_size))); + $packet->size = $packet_length_header_size + $packet_length; + } + break; } + } else { + extract(unpack('Npacket_length', substr($packet->raw, 0, $packet_length_header_size))); + $packet->size = $packet_length_header_size + $packet_length; + $added_validation_length = $packet_length_header_size; } - // quoting , // "implementations SHOULD check that the packet length is reasonable" // PuTTY uses 0x9000 as the actual max packet size and so to shall we - // don't do this when GCM mode is used since GCM mode doesn't encrypt the length - if ($remaining_length < -$this->decrypt_block_size || $remaining_length > 0x9000 || $remaining_length % $this->decrypt_block_size != 0) { - if (!$this->bad_key_size_fix && self::bad_algorithm_candidate($this->decrypt ? $this->decryptName : '') && !($this->bitmap & SSH2::MASK_LOGIN)) { - $this->bad_key_size_fix = true; - $this->reset_connection(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED); - return false; - } - throw new \RuntimeException('Invalid size'); - } - - if ($adjustLength) { - $remaining_length -= $this->decrypt_block_size - 4; + if ( + $packet_length <= 0 || $packet_length > 0x9000 + || ($packet_length + $added_validation_length) % $this->decrypt_block_size != 0 + ) { + $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR); + throw new InvalidPacketLengthException('Invalid packet length'); } - - $buffer = ''; - while ($remaining_length > 0) { - $temp = stream_get_contents($this->fsock, $remaining_length); - if ($temp === false || feof($this->fsock)) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); - throw new \RuntimeException('Error reading from socket'); - } - $buffer .= $temp; - $remaining_length -= strlen($temp); + if ($this->hmac_check instanceof Hash) { + $packet->size += $this->hmac_size; } - - return $buffer; + $packet->packet_length = $packet_length; } /** @@ -3811,44 +3772,54 @@ private function read_remaining_bytes($remaining_length) * * @see self::_get_binary_packet() * @param string $payload - * @param bool $skip_channel_filter - * @return string|bool + * @return string */ - private function filter($payload, $skip_channel_filter) + private function filter($payload) { switch (ord($payload[0])) { case NET_SSH2_MSG_DISCONNECT: Strings::shift($payload, 1); list($reason_code, $message) = Strings::unpackSSH2('Ns', $payload); $this->errors[] = 'SSH_MSG_DISCONNECT: ' . self::$disconnect_reasons[$reason_code] . "\r\n$message"; - $this->bitmap = 0; - return false; + $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); + throw new ConnectionClosedException('Connection closed by server'); case NET_SSH2_MSG_IGNORE: $this->extra_packets++; - $payload = $this->get_binary_packet($skip_channel_filter); + $payload = $this->get_binary_packet(); break; case NET_SSH2_MSG_DEBUG: $this->extra_packets++; Strings::shift($payload, 2); // second byte is "always_display" list($message) = Strings::unpackSSH2('s', $payload); $this->errors[] = "SSH_MSG_DEBUG: $message"; - $payload = $this->get_binary_packet($skip_channel_filter); + $payload = $this->get_binary_packet(); break; case NET_SSH2_MSG_UNIMPLEMENTED: - return false; + break; // return payload case NET_SSH2_MSG_KEXINIT: // this is here for key re-exchanges after the initial key exchange if ($this->session_id !== false) { if (!$this->key_exchange($payload)) { - $this->bitmap = 0; - return false; + $this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED); + throw new ConnectionClosedException('Key exchange failed'); + } + $payload = $this->get_binary_packet(); + } + break; + case NET_SSH2_MSG_EXT_INFO: + Strings::shift($payload, 1); + list($nr_extensions) = Strings::unpackSSH2('N', $payload); + for ($i = 0; $i < $nr_extensions; $i++) { + list($extension_name, $extension_value) = Strings::unpackSSH2('ss', $payload); + if ($extension_name == 'server-sig-algs') { + $this->supported_private_key_algorithms = explode(',', $extension_value); } - $payload = $this->get_binary_packet($skip_channel_filter); } + $payload = $this->get_binary_packet(); } // see http://tools.ietf.org/html/rfc4252#section-5.4; only called when the encryption has been activated and when we haven't already logged in - if (($this->bitmap & self::MASK_CONNECTED) && !$this->isAuthenticated() && !is_bool($payload) && ord($payload[0]) == NET_SSH2_MSG_USERAUTH_BANNER) { + if (($this->bitmap & self::MASK_CONNECTED) && !$this->isAuthenticated() && ord($payload[0]) == NET_SSH2_MSG_USERAUTH_BANNER) { Strings::shift($payload, 1); list($this->banner_message) = Strings::unpackSSH2('s', $payload); $payload = $this->get_binary_packet(); @@ -3856,10 +3827,6 @@ private function filter($payload, $skip_channel_filter) // only called when we've already logged in if (($this->bitmap & self::MASK_CONNECTED) && $this->isAuthenticated()) { - if (is_bool($payload)) { - return $payload; - } - switch (ord($payload[0])) { case NET_SSH2_MSG_CHANNEL_REQUEST: if (strlen($payload) == 31) { @@ -3868,32 +3835,16 @@ private function filter($payload, $skip_channel_filter) if (ord(substr($payload, 9 + $length))) { // want reply $this->send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_SUCCESS, $this->server_channels[$channel])); } - $payload = $this->get_binary_packet($skip_channel_filter); + $payload = $this->get_binary_packet(); } } break; - case NET_SSH2_MSG_CHANNEL_DATA: - case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA: - case NET_SSH2_MSG_CHANNEL_CLOSE: - case NET_SSH2_MSG_CHANNEL_EOF: - if (!$skip_channel_filter && !empty($this->server_channels)) { - $this->binary_packet_buffer = $payload; - $this->get_channel_packet(true); - $payload = $this->get_binary_packet(); - } - break; case NET_SSH2_MSG_GLOBAL_REQUEST: // see http://tools.ietf.org/html/rfc4254#section-4 Strings::shift($payload, 1); list($request_name) = Strings::unpackSSH2('s', $payload); $this->errors[] = "SSH_MSG_GLOBAL_REQUEST: $request_name"; - - try { - $this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE)); - } catch (\RuntimeException $e) { - return $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); - } - - $payload = $this->get_binary_packet($skip_channel_filter); + $this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE)); + $payload = $this->get_binary_packet(); break; case NET_SSH2_MSG_CHANNEL_OPEN: // see http://tools.ietf.org/html/rfc4254#section-5.1 Strings::shift($payload, 1); @@ -3938,23 +3889,11 @@ private function filter($payload, $skip_channel_filter) '', // description '' // language tag ); - - try { - $this->send_binary_packet($packet); - } catch (\RuntimeException $e) { - return $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); - } + $this->send_binary_packet($packet); } - $payload = $this->get_binary_packet($skip_channel_filter); + $payload = $this->get_binary_packet(); break; - case NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST: - Strings::shift($payload, 1); - list($channel, $window_size) = Strings::unpackSSH2('NN', $payload); - - $this->window_size_client_to_server[$channel] += $window_size; - - $payload = ($this->bitmap & self::MASK_WINDOW_ADJUST) ? true : $this->get_binary_packet($skip_channel_filter); } } @@ -4035,6 +3974,7 @@ public function isPTYEnabled() * * - the server closes the channel * - if the connection times out + * - if a window adjust packet is received on the given negated client channel * - if the channel status is CHANNEL_OPEN and the response was CHANNEL_OPEN_CONFIRMATION * - if the channel status is CHANNEL_REQUEST and the response was CHANNEL_SUCCESS * - if the channel status is CHANNEL_CLOSE and the response was CHANNEL_CLOSE @@ -4043,7 +3983,10 @@ public function isPTYEnabled() * * - if the channel status is CHANNEL_REQUEST and the response was CHANNEL_FAILURE * - * @param int $client_channel + * @param int $client_channel Specifies the channel to return data for, and data received + * on other channels is buffered. The respective negative value of a channel is + * also supported for the case that the caller is awaiting adjustment of the data + * window, and where data received on that respective channel is also buffered. * @param bool $skip_extended * @return mixed * @throws \RuntimeException on connection error @@ -4068,27 +4011,15 @@ protected function get_channel_packet($client_channel, $skip_extended = false) } while (true) { - if ($this->binary_packet_buffer !== false) { - $response = $this->binary_packet_buffer; - $this->binary_packet_buffer = false; - } else { - $response = $this->get_binary_packet(true); - if ($response === true && $this->is_timeout) { - if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) { - $this->close_channel($client_channel); - } - return true; - } - if ($response === false) { - $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); - throw new ConnectionClosedException('Connection closed by server'); - } - } - - if ($client_channel == -1 && $response === true) { + try { + $response = $this->get_binary_packet(); + } catch (TimeoutException $e) { return true; } - list($type, $channel) = Strings::unpackSSH2('CN', $response); + list($type) = Strings::unpackSSH2('C', $response); + if (strlen($response) >= 4) { + list($channel) = Strings::unpackSSH2('N', $response); + } // will not be setup yet on incoming channel open request if (isset($channel) && isset($this->channel_status[$channel]) && isset($this->window_size_server_to_client[$channel])) { @@ -4104,6 +4035,14 @@ protected function get_channel_packet($client_channel, $skip_extended = false) } switch ($type) { + case NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST: + list($window_size) = Strings::unpackSSH2('N', $response); + $this->window_size_client_to_server[$channel] += $window_size; + if ($channel == -$client_channel) { + return true; + } + + continue 2; case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA: /* if ($client_channel == self::CHANNEL_EXEC) { @@ -4278,7 +4217,7 @@ protected function get_channel_packet($client_channel, $skip_extended = false) protected function send_binary_packet($data, $logged = null) { if (!is_resource($this->fsock) || feof($this->fsock)) { - $this->bitmap = 0; + $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST); throw new ConnectionClosedException('Connection closed prematurely'); } @@ -4402,11 +4341,11 @@ protected function send_binary_packet($data, $logged = null) $message_number = '-> ' . $message_number . ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; $this->append_log($message_number, $logged); - $this->last_packet = $current; } + $this->last_packet = microtime(true); if (strlen($packet) != $sent) { - $this->bitmap = 0; + $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); $message = $sent === false ? 'Unable to write ' . strlen($packet) . ' bytes' : "Only $sent of " . strlen($packet) . " bytes were sent"; @@ -4414,6 +4353,19 @@ protected function send_binary_packet($data, $logged = null) } } + /** + * Sends a keep-alive message, if keep-alive is enabled and interval is met + */ + private function send_keep_alive() + { + if ($this->bitmap & self::MASK_CONNECTED) { + $elapsed = microtime(true) - $this->last_packet; + if ($this->keepAlive > 0 && $elapsed >= $this->keepAlive) { + $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); + } + } + } + /** * Logs data packets * @@ -4535,12 +4487,24 @@ protected function append_log_helper($constant, $message_number, $message, array */ protected function send_channel_packet($client_channel, $data) { + if ( + isset($this->channel_buffers_write[$client_channel]) + && strpos($data, $this->channel_buffers_write[$client_channel]) === 0 + ) { + // if buffer holds identical initial data content, resume send from the unmatched data portion + $data = substr($data, strlen($this->channel_buffers_write[$client_channel])); + } else { + $this->channel_buffers_write[$client_channel] = ''; + } while (strlen($data)) { if (!$this->window_size_client_to_server[$client_channel]) { - $this->bitmap ^= self::MASK_WINDOW_ADJUST; // using an invalid channel will let the buffers be built up for the valid channels - $this->get_channel_packet(-1); - $this->bitmap ^= self::MASK_WINDOW_ADJUST; + $this->get_channel_packet(-$client_channel); + if ($this->isTimeout()) { + throw new TimeoutException('Timed out waiting for server'); + } elseif (!$this->window_size_client_to_server[$client_channel]) { + throw new \RuntimeException('Data window was not adjusted'); + } } /* The maximum amount of data allowed is determined by the maximum @@ -4561,7 +4525,9 @@ protected function send_channel_packet($client_channel, $data) ); $this->window_size_client_to_server[$client_channel] -= strlen($temp); $this->send_binary_packet($packet); + $this->channel_buffers_write[$client_channel] .= $temp; } + unset($this->channel_buffers_write[$client_channel]); } /** @@ -4635,10 +4601,7 @@ protected function disconnect_helper($reason) } } - $this->bitmap = 0; - if (is_resource($this->fsock) && get_resource_type($this->fsock) === 'stream') { - fclose($this->fsock); - } + $this->reset_connection(); return false; } @@ -4960,10 +4923,30 @@ public static function getSupportedEncryptionAlgorithms() $obj->setKeyLength(preg_replace('#[^\d]#', '', $algo)); } switch ($algo) { + // Eval engines do not exist for ChaCha20 or RC4 because they would not benefit from one. + // to benefit from an Eval engine they'd need to loop a variable amount of times, they'd + // need to do table lookups (eg. sbox subsitutions). ChaCha20 doesn't do either because + // it's a so-called ARX cipher, meaning that the only operations it does are add (A), rotate (R) + // and XOR (X). RC4 does do table lookups but being a stream cipher it works differently than + // block ciphers. with RC4 you XOR the plaintext against a keystream and the keystream changes + // as you encrypt stuff. the only table lookups are made against this keystream and thus table + // lookups are kinda unavoidable. with AES and DES, however, the table lookups that are done + // are done against substitution boxes (sboxes), which are invariant. + + // OpenSSL can't be used as an engine, either, because OpenSSL doesn't support continuous buffers + // as SSH2 uses and altho you can emulate a continuous buffer with block ciphers you can't do so + // with stream ciphers. As for ChaCha20... for the ChaCha20 part OpenSSL could prob be used but + // the big slow down isn't with ChaCha20 - it's with Poly1305. SSH constructs the key for that + // differently than how OpenSSL does it (OpenSSL does it as the RFC describes, SSH doesn't). + + // libsodium can't be used because it doesn't support RC4 and it doesn't construct the Poly1305 + // keys in the same way that SSH does + + // mcrypt could prob be used for RC4 but mcrypt hasn't been included in PHP core for yearss case 'chacha20-poly1305@openssh.com': case 'arcfour128': case 'arcfour256': - if ($engine != 'Eval') { + if ($engine != 'PHP') { continue 2; } break; @@ -5185,7 +5168,7 @@ public function getBannerMessage() * * @return string|false * @throws \RuntimeException on badly formatted keys - * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format + * @throws NoSupportedAlgorithmsException when the key isn't in a supported format */ public function getServerPublicHostKey() { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php index 26ca32275..376d77bfe 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php @@ -33,6 +33,7 @@ namespace phpseclib3\System\SSH; use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\PublicKey; use phpseclib3\Crypt\PublicKeyLoader; use phpseclib3\Crypt\RSA; use phpseclib3\Exception\BadConfigurationException; @@ -110,8 +111,8 @@ class Agent /** * Default Constructor * - * @return \phpseclib3\System\SSH\Agent - * @throws \phpseclib3\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found + * @return Agent + * @throws BadConfigurationException if SSH_AUTH_SOCK cannot be found * @throws \RuntimeException on connection errors */ public function __construct($address = null) @@ -192,7 +193,8 @@ public function requestIdentities() if (isset($key)) { $identity = (new Identity($this->fsock)) ->withPublicKey($key) - ->withPublicKeyBlob($key_blob); + ->withPublicKeyBlob($key_blob) + ->withComment($comment); $identities[] = $identity; unset($key); } @@ -201,6 +203,24 @@ public function requestIdentities() return $identities; } + /** + * Returns the SSH Agent identity matching a given public key or null if no identity is found + * + * @return ?Identity + */ + public function findIdentityByPublicKey(PublicKey $key) + { + $identities = $this->requestIdentities(); + $key = (string) $key; + foreach ($identities as $identity) { + if (((string) $identity->getPublicKey()) == $key) { + return $identity; + } + } + + return null; + } + /** * Signal that agent forwarding should * be requested when a channel is opened @@ -217,7 +237,7 @@ public function startSSHForwarding() /** * Request agent forwarding of remote server * - * @param \phpseclib3\Net\SSH2 $ssh + * @param SSH2 $ssh * @return bool */ private function request_forwarding(SSH2 $ssh) @@ -238,7 +258,7 @@ private function request_forwarding(SSH2 $ssh) * open to give the SSH Agent an opportunity * to take further action. i.e. request agent forwarding * - * @param \phpseclib3\Net\SSH2 $ssh + * @param SSH2 $ssh */ public function registerChannelOpen(SSH2 $ssh) { diff --git a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php index 653e8ea5d..06a4bafd1 100644 --- a/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php +++ b/lam/lib/3rdParty/composer/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php @@ -79,6 +79,13 @@ class Identity implements PrivateKey */ private $flags = 0; + /** + * Comment + * + * @var null|string + */ + private $comment; + /** * Curve Aliases * @@ -106,7 +113,7 @@ public function __construct($fsock) * * Called by \phpseclib3\System\SSH\Agent::requestIdentities() * - * @param \phpseclib3\Crypt\Common\PublicKey $key + * @param PublicKey $key */ public function withPublicKey(PublicKey $key) { @@ -141,10 +148,9 @@ public function withPublicKeyBlob($key_blob) * * Wrapper for $this->key->getPublicKey() * - * @param string $type optional * @return mixed */ - public function getPublicKey($type = 'PKCS8') + public function getPublicKey() { return $this->key; } @@ -261,7 +267,7 @@ public function getCurve() * @param string $message * @return string * @throws \RuntimeException on connection errors - * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws UnsupportedAlgorithmException if the algorithm is unsupported */ public function sign($message) { @@ -317,4 +323,24 @@ public function withPassword($password = false) { throw new \RuntimeException('ssh-agent does not provide a mechanism to get the private key'); } + + /** + * Sets the comment + */ + public function withComment($comment = null) + { + $new = clone $this; + $new->comment = $comment; + return $new; + } + + /** + * Returns the comment + * + * @return null|string + */ + public function getComment() + { + return $this->comment; + } } diff --git a/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareInterface.php b/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareInterface.php index cc46a9514..062187057 100644 --- a/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareInterface.php +++ b/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareInterface.php @@ -9,10 +9,6 @@ interface LoggerAwareInterface { /** * Sets a logger instance on the object. - * - * @param LoggerInterface $logger - * - * @return void */ public function setLogger(LoggerInterface $logger): void; } diff --git a/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareTrait.php b/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareTrait.php index 4fb57a292..85104dbc1 100644 --- a/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareTrait.php +++ b/lam/lib/3rdParty/composer/psr/log/src/LoggerAwareTrait.php @@ -9,15 +9,11 @@ trait LoggerAwareTrait { /** * The logger instance. - * - * @var LoggerInterface|null */ protected ?LoggerInterface $logger = null; /** * Sets a logger. - * - * @param LoggerInterface $logger */ public function setLogger(LoggerInterface $logger): void { diff --git a/lam/lib/3rdParty/composer/psr/log/src/LoggerInterface.php b/lam/lib/3rdParty/composer/psr/log/src/LoggerInterface.php index b3a24b5f7..8afabc90c 100644 --- a/lam/lib/3rdParty/composer/psr/log/src/LoggerInterface.php +++ b/lam/lib/3rdParty/composer/psr/log/src/LoggerInterface.php @@ -22,10 +22,7 @@ interface LoggerInterface /** * System is unusable. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function emergency(string|\Stringable $message, array $context = []): void; @@ -35,10 +32,7 @@ public function emergency(string|\Stringable $message, array $context = []): voi * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function alert(string|\Stringable $message, array $context = []): void; @@ -47,10 +41,7 @@ public function alert(string|\Stringable $message, array $context = []): void; * * Example: Application component unavailable, unexpected exception. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function critical(string|\Stringable $message, array $context = []): void; @@ -58,10 +49,7 @@ public function critical(string|\Stringable $message, array $context = []): void * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function error(string|\Stringable $message, array $context = []): void; @@ -71,20 +59,14 @@ public function error(string|\Stringable $message, array $context = []): void; * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function warning(string|\Stringable $message, array $context = []): void; /** * Normal but significant events. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function notice(string|\Stringable $message, array $context = []): void; @@ -93,32 +75,22 @@ public function notice(string|\Stringable $message, array $context = []): void; * * Example: User logs in, SQL logs. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function info(string|\Stringable $message, array $context = []): void; /** * Detailed debug information. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function debug(string|\Stringable $message, array $context = []): void; /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message * @param mixed[] $context * - * @return void - * * @throws \Psr\Log\InvalidArgumentException */ public function log($level, string|\Stringable $message, array $context = []): void; diff --git a/lam/lib/3rdParty/composer/psr/log/src/LoggerTrait.php b/lam/lib/3rdParty/composer/psr/log/src/LoggerTrait.php index 9c8733f95..a5d9980b6 100644 --- a/lam/lib/3rdParty/composer/psr/log/src/LoggerTrait.php +++ b/lam/lib/3rdParty/composer/psr/log/src/LoggerTrait.php @@ -14,11 +14,6 @@ trait LoggerTrait { /** * System is unusable. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function emergency(string|\Stringable $message, array $context = []): void { @@ -30,11 +25,6 @@ public function emergency(string|\Stringable $message, array $context = []): voi * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function alert(string|\Stringable $message, array $context = []): void { @@ -45,11 +35,6 @@ public function alert(string|\Stringable $message, array $context = []): void * Critical conditions. * * Example: Application component unavailable, unexpected exception. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function critical(string|\Stringable $message, array $context = []): void { @@ -59,11 +44,6 @@ public function critical(string|\Stringable $message, array $context = []): void /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function error(string|\Stringable $message, array $context = []): void { @@ -75,11 +55,6 @@ public function error(string|\Stringable $message, array $context = []): void * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function warning(string|\Stringable $message, array $context = []): void { @@ -88,11 +63,6 @@ public function warning(string|\Stringable $message, array $context = []): void /** * Normal but significant events. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function notice(string|\Stringable $message, array $context = []): void { @@ -103,11 +73,6 @@ public function notice(string|\Stringable $message, array $context = []): void * Interesting events. * * Example: User logs in, SQL logs. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function info(string|\Stringable $message, array $context = []): void { @@ -116,11 +81,6 @@ public function info(string|\Stringable $message, array $context = []): void /** * Detailed debug information. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function debug(string|\Stringable $message, array $context = []): void { @@ -130,11 +90,7 @@ public function debug(string|\Stringable $message, array $context = []): void /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void + * @param mixed $level * * @throws \Psr\Log\InvalidArgumentException */ diff --git a/lam/lib/3rdParty/composer/psr/log/src/NullLogger.php b/lam/lib/3rdParty/composer/psr/log/src/NullLogger.php index c1cc3c069..de0561e2a 100644 --- a/lam/lib/3rdParty/composer/psr/log/src/NullLogger.php +++ b/lam/lib/3rdParty/composer/psr/log/src/NullLogger.php @@ -15,11 +15,7 @@ class NullLogger extends AbstractLogger /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void + * @param mixed[] $context * * @throws \Psr\Log\InvalidArgumentException */ diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/composer.json b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/composer.json index 13925d3fb..77ce00dbd 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/composer.json +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/composer.json @@ -31,20 +31,20 @@ "require-dev": { "ext-json": "*", "ekino/phpstan-banned-code": "^1.0", - "infection/infection": "^0.27", + "infection/infection": "^0.29", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-beberlei-assert": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^10.1", - "rector/rector": "^0.19", + "phpunit/phpunit": "^10.1|^11.0", + "rector/rector": "^1.0", "roave/security-advisories": "dev-latest", "symfony/var-dumper": "^6.0|^7.0", "symplify/easy-coding-standard": "^12.0", "php-parallel-lint/php-parallel-lint": "^1.3", - "qossmic/deptrac-shim": "^1.0" + "qossmic/deptrac": "^2.0" }, "config": { "sort-packages": true, diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/ByteStringObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/ByteStringObject.php index b7bb01fd9..189589aac 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/ByteStringObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/ByteStringObject.php @@ -4,6 +4,8 @@ namespace CBOR; +use function strlen; + /** * @see \CBOR\Test\ByteStringObjectTest */ @@ -46,7 +48,7 @@ public function getValue(): string public function getLength(): int { - return mb_strlen($this->value, '8bit'); + return strlen($this->value); } public function normalize(): string diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Decoder.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Decoder.php index 67e98f7ec..2e8fd2040 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Decoder.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Decoder.php @@ -150,7 +150,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR } return $object; - case CBORObject::MAJOR_TYPE_TEXT_STRING : //3 + case CBORObject::MAJOR_TYPE_TEXT_STRING: //3 $object = IndefiniteLengthTextStringObject::create(); while (! ($it = $this->process($stream, true)) instanceof BreakObject) { if (! $it instanceof TextStringObject) { @@ -162,7 +162,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR } return $object; - case CBORObject::MAJOR_TYPE_LIST : //4 + case CBORObject::MAJOR_TYPE_LIST: //4 $object = IndefiniteLengthListObject::create(); $it = $this->process($stream, true); while (! $it instanceof BreakObject) { @@ -171,23 +171,23 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR } return $object; - case CBORObject::MAJOR_TYPE_MAP : //5 + case CBORObject::MAJOR_TYPE_MAP: //5 $object = IndefiniteLengthMapObject::create(); while (! ($it = $this->process($stream, true)) instanceof BreakObject) { $object->add($it, $this->process($stream, false)); } return $object; - case CBORObject::MAJOR_TYPE_OTHER_TYPE : //7 + case CBORObject::MAJOR_TYPE_OTHER_TYPE: //7 if (! $breakable) { throw new InvalidArgumentException('Cannot parse the data. No enclosing indefinite.'); } return BreakObject::create(); - case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER : //0 - case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER : //1 - case CBORObject::MAJOR_TYPE_TAG : //6 - default : + case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0 + case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1 + case CBORObject::MAJOR_TYPE_TAG: //6 + default: throw new InvalidArgumentException(sprintf( 'Cannot parse the data. Found infinite length for Major Type "%s" (%d).', str_pad(decbin($mt), 5, '0', STR_PAD_LEFT), diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php index ebe97c1b4..0373a70ca 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php @@ -33,9 +33,14 @@ public function __toString(): string return $result . "\xFF"; } - public static function create(): self + public static function create(string ...$chunks): self { - return new self(); + $object = new self(); + foreach ($chunks as $chunk) { + $object->append($chunk); + } + + return $object; } public function add(ByteStringObject $chunk): self diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php index e1bef93e6..480d94a9d 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php @@ -42,9 +42,14 @@ public function __toString(): string return $result . "\xFF"; } - public static function create(): self + public static function create(CBORObject ...$items): self { - return new self(); + $object = new self(); + foreach ($items as $item) { + $object->add($item); + } + + return $object; } /** diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php index bc3a15da9..ccb6d7830 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php @@ -33,9 +33,14 @@ public function __toString(): string return $result . "\xFF"; } - public static function create(): self + public static function create(string ...$chunks): self { - return new self(); + $object = new self(); + foreach ($chunks as $chunk) { + $object->append($chunk); + } + + return $object; } public function add(TextStringObject $chunk): self diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/LengthCalculator.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/LengthCalculator.php index ec8c678c5..da43ce8db 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/LengthCalculator.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/LengthCalculator.php @@ -8,6 +8,7 @@ use InvalidArgumentException; use function chr; use function count; +use function strlen; use const STR_PAD_LEFT; final class LengthCalculator @@ -17,7 +18,7 @@ final class LengthCalculator */ public static function getLengthOfString(string $data): array { - $length = mb_strlen($data, '8bit'); + $length = strlen($data); return self::computeLength($length); } @@ -54,7 +55,7 @@ private static function computeLength(int $length): array private static function hex2bin(string $data): string { - $data = str_pad($data, (int) (2 ** ceil(log(mb_strlen($data, '8bit'), 2))), '0', STR_PAD_LEFT); + $data = str_pad($data, (int) (2 ** ceil(log(strlen($data), 2))), '0', STR_PAD_LEFT); $result = hex2bin($data); if ($result === false) { throw new InvalidArgumentException('Unable to convert the data'); diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php index db3a1d2f6..a08812680 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php @@ -9,6 +9,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -26,7 +27,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 8) { + if (strlen($value) !== 8) { throw new InvalidArgumentException('The value is not a valid double precision floating point'); } diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php index 467e0c292..ba114b9d6 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php @@ -9,6 +9,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -26,7 +27,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 2) { + if (strlen($value) !== 2) { throw new InvalidArgumentException('The value is not a valid half precision floating point'); } diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php index 702542f22..f43a6910a 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php @@ -10,12 +10,13 @@ use InvalidArgumentException; use function chr; use function ord; +use function strlen; final class SimpleObject extends Base implements Normalizable { public static function supportedAdditionalInformation(): array { - return array_merge(range(0, 19), [24]); + return [...range(0, 19), 24]; } public static function create(int $value): self|FalseObject|TrueObject|NullObject|UndefinedObject @@ -46,7 +47,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string if ($data === null) { throw new InvalidArgumentException('Invalid simple value. Content data is missing.'); } - if (mb_strlen($data, '8bit') !== 1) { + if (strlen($data) !== 1) { throw new InvalidArgumentException('Invalid simple value. Content data is too long.'); } if (ord($data) < 32) { diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php index d47cd3095..a381004e2 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php @@ -8,6 +8,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -25,7 +26,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 4) { + if (strlen($value) !== 4) { throw new InvalidArgumentException('The value is not a valid single precision floating point'); } diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/StringStream.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/StringStream.php index d522813a2..82267f6a8 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/StringStream.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/StringStream.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use RuntimeException; +use function strlen; final class StringStream implements Stream { @@ -53,21 +54,21 @@ public function read(int $length): string if ($newData === false) { throw new RuntimeException('Unable to read the memory'); } - if (mb_strlen($newData, '8bit') < $sizeToRead) { + if (strlen($newData) < $sizeToRead) { throw new InvalidArgumentException(sprintf( 'Out of range. Expected: %d, read: %d.', $length, - mb_strlen($data, '8bit') + strlen($data) )); } $data .= $newData; } - if (mb_strlen($data, '8bit') !== $length) { + if (strlen($data) !== $length) { throw new InvalidArgumentException(sprintf( 'Out of range. Expected: %d, read: %d.', $length, - mb_strlen($data, '8bit') + strlen($data) )); } diff --git a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Tag/TimestampTag.php b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Tag/TimestampTag.php index afdec9fdf..a3b457e9a 100644 --- a/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Tag/TimestampTag.php +++ b/lam/lib/3rdParty/composer/spomky-labs/cbor-php/src/Tag/TimestampTag.php @@ -15,6 +15,7 @@ use DateTimeImmutable; use DateTimeInterface; use InvalidArgumentException; +use function strlen; use const STR_PAD_RIGHT; final class TimestampTag extends Tag implements Normalizable @@ -60,8 +61,8 @@ public function normalize(): DateTimeInterface $value = (string) $object->normalize(); $parts = explode('.', $value); if (isset($parts[1])) { - if (mb_strlen($parts[1], '8bit') > 6) { - $parts[1] = mb_substr($parts[1], 0, 6, '8bit'); + if (strlen($parts[1]) > 6) { + $parts[1] = substr($parts[1], 0, 6); } else { $parts[1] = str_pad($parts[1], 6, '0', STR_PAD_RIGHT); } diff --git a/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php b/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php index fef0ad09a..419aa890c 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php @@ -66,7 +66,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface, * * @see HttpClientInterface::OPTIONS_DEFAULTS for available options */ - public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 50) + public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 0) { if (!\extension_loaded('curl')) { throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\CurlHttpClient" as the "curl" extension is not installed.'); @@ -188,10 +188,10 @@ public function request(string $method, string $url, array $options = []): Respo $multi->reset(); } - foreach ($options['resolve'] as $host => $ip) { - $resolve[] = null === $ip ? "-$host:$port" : "$host:$port:$ip"; - $multi->dnsCache->hostnames[$host] = $ip; - $multi->dnsCache->removals["-$host:$port"] = "-$host:$port"; + foreach ($options['resolve'] as $resolveHost => $ip) { + $resolve[] = null === $ip ? "-$resolveHost:$port" : "$resolveHost:$port:$ip"; + $multi->dnsCache->hostnames[$resolveHost] = $ip; + $multi->dnsCache->removals["-$resolveHost:$port"] = "-$resolveHost:$port"; } $curlopts[\CURLOPT_RESOLVE] = $resolve; @@ -250,8 +250,9 @@ public function request(string $method, string $url, array $options = []): Respo if (isset($options['normalized_headers']['content-length'][0])) { $curlopts[\CURLOPT_INFILESIZE] = (int) substr($options['normalized_headers']['content-length'][0], \strlen('Content-Length: ')); - } elseif (!isset($options['normalized_headers']['transfer-encoding'])) { - $curlopts[\CURLOPT_INFILESIZE] = -1; + } + if (!isset($options['normalized_headers']['transfer-encoding'])) { + $curlopts[\CURLOPT_HTTPHEADER][] = 'Transfer-Encoding:'.(isset($curlopts[\CURLOPT_INFILESIZE]) ? '' : ' chunked'); } if ('POST' !== $method) { diff --git a/lam/lib/3rdParty/composer/symfony/http-client/EventSourceHttpClient.php b/lam/lib/3rdParty/composer/symfony/http-client/EventSourceHttpClient.php index 4e551ac04..b5f88ddba 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/EventSourceHttpClient.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/EventSourceHttpClient.php @@ -11,6 +11,7 @@ namespace Symfony\Component\HttpClient; +use Symfony\Component\HttpClient\Chunk\DataChunk; use Symfony\Component\HttpClient\Chunk\ServerSentEvent; use Symfony\Component\HttpClient\Exception\EventSourceException; use Symfony\Component\HttpClient\Response\AsyncContext; @@ -121,17 +122,30 @@ public function request(string $method, string $url, array $options = []): Respo return; } - $rx = '/((?:\r\n){2,}|\r{2,}|\n{2,})/'; - $content = $state->buffer.$chunk->getContent(); - if ($chunk->isLast()) { - $rx = substr_replace($rx, '|$', -2, 0); + if ('' !== $content = $state->buffer) { + $state->buffer = ''; + yield new DataChunk(-1, $content); + } + + yield $chunk; + + return; } - $events = preg_split($rx, $content, -1, \PREG_SPLIT_DELIM_CAPTURE); + + $content = $state->buffer.$chunk->getContent(); + $events = preg_split('/((?:\r\n){2,}|\r{2,}|\n{2,})/', $content, -1, \PREG_SPLIT_DELIM_CAPTURE); $state->buffer = array_pop($events); for ($i = 0; isset($events[$i]); $i += 2) { - $event = new ServerSentEvent($events[$i].$events[1 + $i]); + $content = $events[$i].$events[1 + $i]; + if (!preg_match('/(?:^|\r\n|[\r\n])[^:\r\n]/', $content)) { + yield new DataChunk(-1, $content); + + continue; + } + + $event = new ServerSentEvent($content); if ('' !== $event->getId()) { $context->setInfo('last_event_id', $state->lastEventId = $event->getId()); @@ -143,17 +157,6 @@ public function request(string $method, string $url, array $options = []): Respo yield $event; } - - if (preg_match('/^(?::[^\r\n]*+(?:\r\n|[\r\n]))+$/m', $state->buffer)) { - $content = $state->buffer; - $state->buffer = ''; - - yield $context->createChunk($content); - } - - if ($chunk->isLast()) { - yield $chunk; - } }); } } diff --git a/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php b/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php index b83baf1f4..393da774c 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php @@ -557,6 +557,8 @@ private static function jsonEncode(mixed $value, ?int $flags = null, int $maxDep */ private static function resolveUrl(array $url, ?array $base, array $queryDefaults = []): array { + $givenUrl = $url; + if (null !== $base && '' === ($base['scheme'] ?? '').($base['authority'] ?? '')) { throw new InvalidArgumentException(sprintf('Invalid "base_uri" option: host or scheme is missing in "%s".', implode('', $base))); } @@ -610,6 +612,10 @@ private static function resolveUrl(array $url, ?array $base, array $queryDefault $url['query'] = null; } + if (null !== $url['scheme'] && null === $url['authority']) { + throw new InvalidArgumentException(\sprintf('Invalid URL: host is missing in "%s".', implode('', $givenUrl))); + } + return $url; } diff --git a/lam/lib/3rdParty/composer/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/lam/lib/3rdParty/composer/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php index 5d1802561..f02793d3e 100644 --- a/lam/lib/3rdParty/composer/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ b/lam/lib/3rdParty/composer/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -216,7 +216,7 @@ public function getMetadataBag(): MetadataBag */ protected function generateId(): string { - return hash('sha256', uniqid('ss_mock_', true)); + return bin2hex(random_bytes(16)); } /** diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/Mbstring.php b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/Mbstring.php index 2e0b96940..1ad33a86b 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/Mbstring.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,8 @@ * - mb_strstr - Finds first occurrence of a string within another * - mb_strwidth - Return width of string * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -80,6 +82,21 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { + if (\is_array($s)) { + if (PHP_VERSION_ID < 70200) { + trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { @@ -410,7 +427,7 @@ public static function mb_encoding_aliases($encoding) public static function mb_check_encoding($var = null, $encoding = null) { - if (PHP_VERSION_ID < 70200 && \is_array($var)) { + if (\PHP_VERSION_ID < 70200 && \is_array($var)) { trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); return null; @@ -437,7 +454,6 @@ public static function mb_check_encoding($var = null, $encoding = null) } return true; - } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -827,7 +843,7 @@ public static function mb_ord($s, $encoding = null) return $code; } - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string { if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); @@ -835,17 +851,8 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin if (null === $encoding) { $encoding = self::mb_internal_encoding(); - } - - try { - $validEncoding = @self::mb_check_encoding('', $encoding); - } catch (\ValueError $e) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - // BC for PHP 7.3 and lower - if (!$validEncoding) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); } if (self::mb_strlen($pad_string, $encoding) <= 0) { @@ -871,6 +878,34 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin } } + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -944,4 +979,18 @@ private static function getEncoding($encoding) return $encoding; } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + } } diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap.php b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap.php index ecf1a0352..6e4b5fce8 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap.php @@ -136,6 +136,14 @@ function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstrin function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } } +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap80.php b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap80.php index 2f9fb5b42..ec2ae4276 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap80.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-mbstring/bootstrap80.php @@ -132,6 +132,14 @@ function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = nul function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } } +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-php83/Php83.php b/lam/lib/3rdParty/composer/symfony/polyfill-php83/Php83.php index 209172bfa..3d94b6c32 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-php83/Php83.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-php83/Php83.php @@ -40,7 +40,7 @@ public static function json_validate(string $json, int $depth = 512, int $flags return \JSON_ERROR_NONE === json_last_error(); } - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string { if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); @@ -90,17 +90,17 @@ public static function str_increment(string $string): string throw new \ValueError('str_increment(): Argument #1 ($string) cannot be empty'); } - if (!\preg_match("/^[a-zA-Z0-9]+$/", $string)) { + if (!preg_match('/^[a-zA-Z0-9]+$/', $string)) { throw new \ValueError('str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters'); } - if (\is_numeric($string)) { + if (is_numeric($string)) { $offset = stripos($string, 'e'); - if ($offset !== false) { + if (false !== $offset) { $char = $string[$offset]; - $char++; + ++$char; $string[$offset] = $char; - $string++; + ++$string; switch ($string[$offset]) { case 'f': @@ -130,28 +130,28 @@ public static function str_decrement(string $string): string throw new \ValueError('str_decrement(): Argument #1 ($string) cannot be empty'); } - if (!\preg_match("/^[a-zA-Z0-9]+$/", $string)) { + if (!preg_match('/^[a-zA-Z0-9]+$/', $string)) { throw new \ValueError('str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters'); } - if (\preg_match('/\A(?:0[aA0]?|[aA])\z/', $string)) { + if (preg_match('/\A(?:0[aA0]?|[aA])\z/', $string)) { throw new \ValueError(sprintf('str_decrement(): Argument #1 ($string) "%s" is out of decrement range', $string)); } if (!\in_array(substr($string, -1), ['A', 'a', '0'], true)) { - return join('', array_slice(str_split($string), 0, -1)) . chr(ord(substr($string, -1)) - 1); + return implode('', \array_slice(str_split($string), 0, -1)).\chr(\ord(substr($string, -1)) - 1); } $carry = ''; $decremented = ''; - for ($i = strlen($string) - 1; $i >= 0; $i--) { + for ($i = \strlen($string) - 1; $i >= 0; --$i) { $char = $string[$i]; switch ($char) { case 'A': if ('' !== $carry) { - $decremented = $carry . $decremented; + $decremented = $carry.$decremented; $carry = ''; } $carry = 'Z'; @@ -159,7 +159,7 @@ public static function str_decrement(string $string): string break; case 'a': if ('' !== $carry) { - $decremented = $carry . $decremented; + $decremented = $carry.$decremented; $carry = ''; } $carry = 'z'; @@ -167,7 +167,7 @@ public static function str_decrement(string $string): string break; case '0': if ('' !== $carry) { - $decremented = $carry . $decremented; + $decremented = $carry.$decremented; $carry = ''; } $carry = '9'; @@ -175,19 +175,19 @@ public static function str_decrement(string $string): string break; case '1': if ('' !== $carry) { - $decremented = $carry . $decremented; + $decremented = $carry.$decremented; $carry = ''; } break; default: if ('' !== $carry) { - $decremented = $carry . $decremented; + $decremented = $carry.$decremented; $carry = ''; } if (!\in_array($char, ['A', 'a', '0'], true)) { - $decremented = chr(ord($char) - 1) . $decremented; + $decremented = \chr(\ord($char) - 1).$decremented; } } } diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap.php b/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap.php index bcb70e486..f43af17e0 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap.php @@ -40,7 +40,7 @@ function str_decrement(string $string): string { return p\Php83::str_decrement($ } if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) { - function ldap_exop_sync($ldap, string $request_oid, string $request_data = null, array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } + function ldap_exop_sync($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } } if (!function_exists('ldap_connect_wallet') && function_exists('ldap_connect')) { diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap81.php b/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap81.php index 63a4f7800..68395b439 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap81.php +++ b/lam/lib/3rdParty/composer/symfony/polyfill-php83/bootstrap81.php @@ -14,7 +14,7 @@ } if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) { - function ldap_exop_sync(\LDAP\Connection $ldap, string $request_oid, string $request_data = null, array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } + function ldap_exop_sync(\LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } } if (!function_exists('ldap_connect_wallet') && function_exists('ldap_connect')) { diff --git a/lam/lib/3rdParty/composer/symfony/polyfill-php83/composer.json b/lam/lib/3rdParty/composer/symfony/polyfill-php83/composer.json index a5fb4241d..02a0bf830 100644 --- a/lam/lib/3rdParty/composer/symfony/polyfill-php83/composer.json +++ b/lam/lib/3rdParty/composer/symfony/polyfill-php83/composer.json @@ -16,8 +16,7 @@ } ], "require": { - "php": ">=7.1", - "symfony/polyfill-php80": "^1.14" + "php": ">=7.1" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php83\\": "" }, diff --git a/lam/lib/3rdParty/composer/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php b/lam/lib/3rdParty/composer/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php index b1ee25a40..cad798e5f 100644 --- a/lam/lib/3rdParty/composer/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php +++ b/lam/lib/3rdParty/composer/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php @@ -132,89 +132,12 @@ public function createResponse(ResponseInterface $psrResponse, bool $streamed = $response->setProtocolVersion($psrResponse->getProtocolVersion()); foreach ($cookies as $cookie) { - $response->headers->setCookie($this->createCookie($cookie)); + $response->headers->setCookie(Cookie::fromString($cookie)); } return $response; } - /** - * Creates a Cookie instance from a cookie string. - * - * Some snippets have been taken from the Guzzle project: https://github.com/guzzle/guzzle/blob/5.3/src/Cookie/SetCookie.php#L34 - * - * @throws \InvalidArgumentException - */ - private function createCookie(string $cookie): Cookie - { - foreach (explode(';', $cookie) as $part) { - $part = trim($part); - - $data = explode('=', $part, 2); - $name = $data[0]; - $value = isset($data[1]) ? trim($data[1], " \n\r\t\0\x0B\"") : null; - - if (!isset($cookieName)) { - $cookieName = $name; - $cookieValue = $value; - - continue; - } - - if ('expires' === strtolower($name) && null !== $value) { - $cookieExpire = new \DateTime($value); - - continue; - } - - if ('path' === strtolower($name) && null !== $value) { - $cookiePath = $value; - - continue; - } - - if ('domain' === strtolower($name) && null !== $value) { - $cookieDomain = $value; - - continue; - } - - if ('secure' === strtolower($name)) { - $cookieSecure = true; - - continue; - } - - if ('httponly' === strtolower($name)) { - $cookieHttpOnly = true; - - continue; - } - - if ('samesite' === strtolower($name) && null !== $value) { - $samesite = $value; - - continue; - } - } - - if (!isset($cookieName)) { - throw new \InvalidArgumentException('The value of the Set-Cookie header is malformed.'); - } - - return new Cookie( - $cookieName, - $cookieValue, - $cookieExpire ?? 0, - $cookiePath ?? '/', - $cookieDomain ?? null, - isset($cookieSecure), - isset($cookieHttpOnly), - true, - $samesite ?? null - ); - } - private function createStreamedResponseCallback(StreamInterface $body): callable { return function () use ($body) { diff --git a/lam/lib/3rdParty/composer/symfony/translation/Loader/CsvFileLoader.php b/lam/lib/3rdParty/composer/symfony/translation/Loader/CsvFileLoader.php index 7f2f96be6..93bee730b 100644 --- a/lam/lib/3rdParty/composer/symfony/translation/Loader/CsvFileLoader.php +++ b/lam/lib/3rdParty/composer/symfony/translation/Loader/CsvFileLoader.php @@ -22,7 +22,7 @@ class CsvFileLoader extends FileLoader { private string $delimiter = ';'; private string $enclosure = '"'; - private string $escape = '\\'; + private string $escape = ''; protected function loadResource(string $resource): array { @@ -55,7 +55,7 @@ protected function loadResource(string $resource): array * * @return void */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') + public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '') { $this->delimiter = $delimiter; $this->enclosure = $enclosure; diff --git a/lam/lib/3rdParty/composer/symfony/uid/UuidV1.php b/lam/lib/3rdParty/composer/symfony/uid/UuidV1.php index 1ec004168..1e6873708 100644 --- a/lam/lib/3rdParty/composer/symfony/uid/UuidV1.php +++ b/lam/lib/3rdParty/composer/symfony/uid/UuidV1.php @@ -25,7 +25,7 @@ class UuidV1 extends Uuid implements TimeBasedUidInterface public function __construct(?string $uuid = null) { if (null === $uuid) { - $this->uid = uuid_create(static::TYPE); + $this->uid = strtolower(uuid_create(static::TYPE)); } else { parent::__construct($uuid, true); }