diff --git a/site/composer.lock b/site/composer.lock index 053680929..d499c3183 100644 --- a/site/composer.lock +++ b/site/composer.lock @@ -8,20 +8,20 @@ "packages": [ { "name": "contributte/translation", - "version": "v2.0.3", + "version": "v2.0.4", "source": { "type": "git", "url": "https://github.com/contributte/translation.git", - "reference": "a8192980a8b48df411c3be68a22a082b75e41505" + "reference": "ae4ff4e12095220161f2948e5cadc59f42a1936c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/contributte/translation/zipball/a8192980a8b48df411c3be68a22a082b75e41505", - "reference": "a8192980a8b48df411c3be68a22a082b75e41505", + "url": "https://api.github.com/repos/contributte/translation/zipball/ae4ff4e12095220161f2948e5cadc59f42a1936c", + "reference": "ae4ff4e12095220161f2948e5cadc59f42a1936c", "shasum": "" }, "require": { - "latte/latte": "^2.6|^3.0", + "latte/latte": "^2.6|^3.0.12", "nette/di": "^3.0.6", "nette/finder": "^2.5.2|~3.0.0", "nette/http": "^3.0.7", @@ -30,24 +30,24 @@ "nette/schema": "^1.0", "nette/utils": "^3.2.1|~4.0.0", "php": "^8.0.2", - "symfony/config": "^6.0", - "symfony/translation": "^6.0" + "symfony/config": "^6.0|^7.0", + "symfony/translation": "^6.0|^7.0" }, "require-dev": { "doctrine/orm": "^2.8", "mockery/mockery": "^1.4", "nette/application": "^3.1.0", - "nette/bootstrap": "^3.0", + "nette/bootstrap": "^3.2.1", "nette/database": "^3.1.1", "nette/robot-loader": "^3.4.0|~4.0.0", "nette/tester": "^2.3.1", - "ninjify/nunjuck": "^0.3.0", + "ninjify/nunjuck": "^0.4.0", "ninjify/qa": "^0.13", "phpstan/phpstan": "^1.8", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-nette": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "psr/log": "^1.1", + "psr/log": "^1.1|^2.0|^3.0", "tracy/tracy": "^2.8" }, "type": "library", @@ -79,7 +79,7 @@ ], "support": { "issues": "https://github.com/contributte/translation/issues", - "source": "https://github.com/contributte/translation/tree/v2.0.3" + "source": "https://github.com/contributte/translation/tree/v2.0.4" }, "funding": [ { @@ -91,7 +91,7 @@ "type": "github" } ], - "time": "2023-03-13T19:07:37+00:00" + "time": "2024-01-26T13:54:18+00:00" }, { "name": "latte/latte", @@ -623,36 +623,36 @@ }, { "name": "nette/di", - "version": "v3.1.8", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "adf475076dae08109dd0d57b1a48668d1d1bedf0" + "reference": "8140289e32e1b2bf2d8b5986bd92124b87fe6b2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/adf475076dae08109dd0d57b1a48668d1d1bedf0", - "reference": "adf475076dae08109dd0d57b1a48668d1d1bedf0", + "url": "https://api.github.com/repos/nette/di/zipball/8140289e32e1b2bf2d8b5986bd92124b87fe6b2f", + "reference": "8140289e32e1b2bf2d8b5986bd92124b87fe6b2f", "shasum": "" }, "require": { "ext-tokenizer": "*", "nette/neon": "^3.3 || ^4.0", - "nette/php-generator": "^3.5.4 || ^4.0", - "nette/robot-loader": "^3.2 || ~4.0.0", + "nette/php-generator": "^4.1.3", + "nette/robot-loader": "^4.0", "nette/schema": "^1.2.5", - "nette/utils": "^3.2.5 || ~4.0.0", - "php": "7.2 - 8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.3" }, "require-dev": { - "nette/tester": "^2.4", + "nette/tester": "^2.5.2", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -689,9 +689,9 @@ ], "support": { "issues": "https://github.com/nette/di/issues", - "source": "https://github.com/nette/di/tree/v3.1.8" + "source": "https://github.com/nette/di/tree/v3.2.0" }, - "time": "2023-11-03T00:12:52+00:00" + "time": "2024-02-06T01:22:10+00:00" }, { "name": "nette/forms", @@ -2225,16 +2225,16 @@ }, { "name": "symfony/cache", - "version": "v7.0.2", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "378e30a864c868d635353f103a5a5e7569f029ec" + "reference": "2207eceb2433d74df81232d97439bf508cb9e050" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/378e30a864c868d635353f103a5a5e7569f029ec", - "reference": "378e30a864c868d635353f103a5a5e7569f029ec", + "url": "https://api.github.com/repos/symfony/cache/zipball/2207eceb2433d74df81232d97439bf508cb9e050", + "reference": "2207eceb2433d74df81232d97439bf508cb9e050", "shasum": "" }, "require": { @@ -2301,7 +2301,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.0.2" + "source": "https://github.com/symfony/cache/tree/v7.0.3" }, "funding": [ { @@ -2317,7 +2317,7 @@ "type": "tidelift" } ], - "time": "2023-12-29T15:37:40+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/cache-contracts", @@ -2397,34 +2397,34 @@ }, { "name": "symfony/config", - "version": "v6.4.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e" + "reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5d33e0fb707d603330e0edfd4691803a1253572e", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e", + "url": "https://api.github.com/repos/symfony/config/zipball/86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16", + "reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2452,7 +2452,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.0" + "source": "https://github.com/symfony/config/tree/v7.0.3" }, "funding": [ { @@ -2468,7 +2468,7 @@ "type": "tidelift" } ], - "time": "2023-11-09T08:28:32+00:00" + "time": "2024-01-30T08:34:29+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2539,16 +2539,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.0.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", - "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", "shasum": "" }, "require": { @@ -2582,7 +2582,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.0" + "source": "https://github.com/symfony/filesystem/tree/v7.0.3" }, "funding": [ { @@ -2598,7 +2598,7 @@ "type": "tidelift" } ], - "time": "2023-07-27T06:33:22+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/service-contracts", @@ -2684,51 +2684,50 @@ }, { "name": "symfony/translation", - "version": "v6.4.2", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681" + "reference": "7285f25c7dcc74d9ec1232473114274604e50f00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", + "url": "https://api.github.com/repos/symfony/translation/zipball/7285f25c7dcc74d9ec1232473114274604e50f00", + "reference": "7285f25c7dcc74d9ec1232473114274604e50f00", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/http-kernel": "<5.4", + "symfony/http-kernel": "<6.4", "symfony/service-contracts": "<2.5", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/routing": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2759,7 +2758,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.2" + "source": "https://github.com/symfony/translation/tree/v7.0.3" }, "funding": [ { @@ -2775,7 +2774,7 @@ "type": "tidelift" } ], - "time": "2023-12-18T09:25:29+00:00" + "time": "2024-01-29T15:41:16+00:00" }, { "name": "symfony/translation-contracts", @@ -2857,16 +2856,16 @@ }, { "name": "symfony/var-exporter", - "version": "v7.0.2", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764" + "reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/345c62fefe92243c3a06fc0cc65f2ec1a47e0764", - "reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/1fb79308cb5fc2b44bff6e8af10a5af6812e05b8", + "reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8", "shasum": "" }, "require": { @@ -2911,7 +2910,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.0.2" + "source": "https://github.com/symfony/var-exporter/tree/v7.0.3" }, "funding": [ { @@ -2927,7 +2926,7 @@ "type": "tidelift" } ], - "time": "2023-12-27T08:42:13+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "texy/texy", @@ -3363,16 +3362,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.56", + "version": "1.10.57", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa" + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", "shasum": "" }, "require": { @@ -3421,7 +3420,7 @@ "type": "tidelift" } ], - "time": "2024-01-15T10:43:00+00:00" + "time": "2024-01-24T11:51:34+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -3574,12 +3573,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "f81bd7cb90f5f30d3b246e342843ae905947158f" + "reference": "f987aa7e659fe7b118c5564974a6ef9e37b1dd0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f81bd7cb90f5f30d3b246e342843ae905947158f", - "reference": "f81bd7cb90f5f30d3b246e342843ae905947158f", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f987aa7e659fe7b118c5564974a6ef9e37b1dd0f", + "reference": "f987aa7e659fe7b118c5564974a6ef9e37b1dd0f", "shasum": "" }, "conflict": { @@ -3619,7 +3618,7 @@ "backpack/crud": "<3.4.9", "bacula-web/bacula-web": "<8.0.0.0-RC2-dev", "badaso/core": "<2.7", - "bagisto/bagisto": "<0.1.5", + "bagisto/bagisto": "<1.3.2", "barrelstrength/sprout-base-email": "<1.2.7", "barrelstrength/sprout-forms": "<3.9", "barryvdh/laravel-translation-manager": "<0.6.2", @@ -3633,12 +3632,13 @@ "bolt/bolt": "<3.7.2", "bolt/core": "<=4.2", "bottelet/flarepoint": "<2.2.1", + "bref/bref": "<2.1.13", "brightlocal/phpwhois": "<=4.2.5", "brotkrueml/codehighlight": "<2.7", "brotkrueml/schema": "<1.13.1|>=2,<2.5.1", "brotkrueml/typo3-matomo-integration": "<1.3.2", "buddypress/buddypress": "<7.2.1", - "bugsnag/bugsnag-laravel": "<2.0.2", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "bytefury/crater": "<6.0.2", "cachethq/cachet": "<2.5.1", "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.1,<4.1.4|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", @@ -3671,7 +3671,7 @@ "contao/managed-edition": "<=1.5", "corveda/phpsandbox": "<1.3.5", "cosenary/instagram": "<=2.3", - "craftcms/cms": "<=4.5.10", + "craftcms/cms": "<4.6.2", "croogo/croogo": "<4", "cuyz/valinor": "<0.12", "czproject/git-php": "<4.0.3", @@ -3686,7 +3686,7 @@ "desperado/xml-bundle": "<=0.1.7", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", "doctrine/annotations": "<1.2.7", - "doctrine/cache": "<1.3.2|>=1.4,<1.4.2", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": "<2.4.3|>=2.5,<2.5.1", "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4", "doctrine/doctrine-bundle": "<1.5.2", @@ -3729,7 +3729,7 @@ "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", - "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.06,<=2019.03.5.1", + "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", @@ -3781,7 +3781,7 @@ "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<2.2.1", "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<6.1.1", + "grumpydictator/firefly-iii": "<6.1.7", "gugoan/economizzer": "<=0.9.0.0-beta1", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", @@ -3803,7 +3803,7 @@ "ibexa/user": ">=4,<4.4.3", "icecoder/icecoder": "<=8.1", "idno/known": "<=1.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/auth": "<5.5.10", "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", @@ -3863,7 +3863,7 @@ "liftkit/database": "<2.13.2", "limesurvey/limesurvey": "<3.27.19", "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6", + "livewire/livewire": ">2.2.4,<2.2.6|>=3,<3.0.4", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", @@ -3879,7 +3879,7 @@ "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", "mautic/core": "<4.3", - "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "mediawiki/core": "<1.36.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", "melisplatform/melis-asset-manager": "<5.0.1", @@ -3967,7 +3967,7 @@ "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", "phpmyadmin/phpmyadmin": "<5.2.1", - "phpmyfaq/phpmyfaq": "<=3.1.7", + "phpmyfaq/phpmyfaq": "<3.2.5", "phpoffice/phpexcel": "<1.8", "phpoffice/phpspreadsheet": "<1.16", "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.34", @@ -3978,7 +3978,7 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<1.2.2", + "pimcore/admin-ui-classic-bundle": "<1.3.2", "pimcore/customer-management-framework-bundle": "<4.0.6", "pimcore/data-hub": "<1.2.4", "pimcore/demo": "<10.3", @@ -4002,7 +4002,7 @@ "prestashop/ps_facetedsearch": "<3.4.1", "prestashop/ps_linklist": "<3.1", "privatebin/privatebin": "<1.4", - "processwire/processwire": "<=3.0.200", + "processwire/processwire": "<=3.0.210", "propel/propel": ">=2.0.0.0-alpha1,<=2.0.0.0-alpha7", "propel/propel1": ">=1,<=1.7.1", "pterodactyl/panel": "<1.7", @@ -4043,13 +4043,13 @@ "shopxo/shopxo": "<2.2.6", "showdoc/showdoc": "<2.10.4", "silverstripe-australia/advancedreports": ">=1,<=2", - "silverstripe/admin": "<1.13.6", + "silverstripe/admin": "<1.13.19|>=2,<2.1.8", "silverstripe/assets": ">=1,<1.11.1", "silverstripe/cms": "<4.11.3", "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.13.14|>=5,<5.0.13", - "silverstripe/graphql": "<3.8.2|>=4,<4.1.3|>=4.2,<4.2.5|>=4.3,<4.3.4|>=5,<5.0.3", + "silverstripe/framework": "<4.13.39|>=5,<5.1.11", + "silverstripe/graphql": "<3.8.2|>=4,<4.3.7|>=5,<5.1.3", "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", "silverstripe/recipe-cms": ">=4.5,<4.5.3", "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", @@ -4082,13 +4082,14 @@ "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "ssddanbrown/bookstack": "<22.02.3", - "statamic/cms": "<4.36", + "statamic/cms": "<4.46", "stormpath/sdk": "<9.9.99", "studio-42/elfinder": "<2.1.62", "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", - "sulu/sulu": "<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8|==2.4.0.0-RC1|>=2.5,<2.5.10", + "sulu/sulu": "<1.6.44|>=2,<2.4.16|>=2.5,<2.5.12", "sumocoders/framework-user-bundle": "<1.4", + "superbig/craft-audit": "<3.0.2", "swag/paypal": "<5.4.4", "swiftmailer/swiftmailer": ">=4,<5.4.5", "swiftyedit/swiftyedit": "<1.2", @@ -4225,7 +4226,7 @@ "yourls/yourls": "<=1.8.2", "zencart/zencart": "<=1.5.7.0-beta", "zendesk/zendesk_api_client_php": "<2.2.11", - "zendframework/zend-cache": "<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", @@ -4257,7 +4258,7 @@ "zenstruck/collection": "<0.2.1", "zetacomponents/mail": "<1.8.2", "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": "<1.0.3", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", "zfr/zfr-oauth2-server-module": "<0.1.2", "zoujingli/thinkadmin": "<=6.1.53" }, @@ -4297,7 +4298,7 @@ "type": "tidelift" } ], - "time": "2024-01-17T21:04:22+00:00" + "time": "2024-02-05T21:04:15+00:00" }, { "name": "slevomat/coding-standard", diff --git a/site/vendor/composer/autoload_classmap.php b/site/vendor/composer/autoload_classmap.php index 19a9147bc..9a744d0cf 100644 --- a/site/vendor/composer/autoload_classmap.php +++ b/site/vendor/composer/autoload_classmap.php @@ -375,14 +375,12 @@ 'Nette\\DI\\Definitions\\Statement' => $vendorDir . '/nette/di/src/DI/Definitions/Statement.php', 'Nette\\DI\\DependencyChecker' => $vendorDir . '/nette/di/src/DI/DependencyChecker.php', 'Nette\\DI\\DynamicParameter' => $vendorDir . '/nette/di/src/DI/DynamicParameter.php', - 'Nette\\DI\\Extensions\\ConstantsExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ConstantsExtension.php', 'Nette\\DI\\Extensions\\DIExtension' => $vendorDir . '/nette/di/src/DI/Extensions/DIExtension.php', 'Nette\\DI\\Extensions\\DecoratorExtension' => $vendorDir . '/nette/di/src/DI/Extensions/DecoratorExtension.php', 'Nette\\DI\\Extensions\\DefinitionSchema' => $vendorDir . '/nette/di/src/DI/Extensions/DefinitionSchema.php', 'Nette\\DI\\Extensions\\ExtensionsExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ExtensionsExtension.php', 'Nette\\DI\\Extensions\\InjectExtension' => $vendorDir . '/nette/di/src/DI/Extensions/InjectExtension.php', 'Nette\\DI\\Extensions\\ParametersExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ParametersExtension.php', - 'Nette\\DI\\Extensions\\PhpExtension' => $vendorDir . '/nette/di/src/DI/Extensions/PhpExtension.php', 'Nette\\DI\\Extensions\\SearchExtension' => $vendorDir . '/nette/di/src/DI/Extensions/SearchExtension.php', 'Nette\\DI\\Extensions\\ServicesExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ServicesExtension.php', 'Nette\\DI\\Helpers' => $vendorDir . '/nette/di/src/DI/Helpers.php', diff --git a/site/vendor/composer/autoload_static.php b/site/vendor/composer/autoload_static.php index 64d7f5f63..69e19d46d 100644 --- a/site/vendor/composer/autoload_static.php +++ b/site/vendor/composer/autoload_static.php @@ -560,14 +560,12 @@ class ComposerStaticInit247de957f14f643f393d210a332dd05b 'Nette\\DI\\Definitions\\Statement' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/Statement.php', 'Nette\\DI\\DependencyChecker' => __DIR__ . '/..' . '/nette/di/src/DI/DependencyChecker.php', 'Nette\\DI\\DynamicParameter' => __DIR__ . '/..' . '/nette/di/src/DI/DynamicParameter.php', - 'Nette\\DI\\Extensions\\ConstantsExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ConstantsExtension.php', 'Nette\\DI\\Extensions\\DIExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/DIExtension.php', 'Nette\\DI\\Extensions\\DecoratorExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/DecoratorExtension.php', 'Nette\\DI\\Extensions\\DefinitionSchema' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/DefinitionSchema.php', 'Nette\\DI\\Extensions\\ExtensionsExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ExtensionsExtension.php', 'Nette\\DI\\Extensions\\InjectExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/InjectExtension.php', 'Nette\\DI\\Extensions\\ParametersExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ParametersExtension.php', - 'Nette\\DI\\Extensions\\PhpExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/PhpExtension.php', 'Nette\\DI\\Extensions\\SearchExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/SearchExtension.php', 'Nette\\DI\\Extensions\\ServicesExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ServicesExtension.php', 'Nette\\DI\\Helpers' => __DIR__ . '/..' . '/nette/di/src/DI/Helpers.php', diff --git a/site/vendor/composer/installed.json b/site/vendor/composer/installed.json index 122d82340..5fd222b66 100644 --- a/site/vendor/composer/installed.json +++ b/site/vendor/composer/installed.json @@ -2,21 +2,21 @@ "packages": [ { "name": "contributte/translation", - "version": "v2.0.3", - "version_normalized": "2.0.3.0", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", "url": "https://github.com/contributte/translation.git", - "reference": "a8192980a8b48df411c3be68a22a082b75e41505" + "reference": "ae4ff4e12095220161f2948e5cadc59f42a1936c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/contributte/translation/zipball/a8192980a8b48df411c3be68a22a082b75e41505", - "reference": "a8192980a8b48df411c3be68a22a082b75e41505", + "url": "https://api.github.com/repos/contributte/translation/zipball/ae4ff4e12095220161f2948e5cadc59f42a1936c", + "reference": "ae4ff4e12095220161f2948e5cadc59f42a1936c", "shasum": "" }, "require": { - "latte/latte": "^2.6|^3.0", + "latte/latte": "^2.6|^3.0.12", "nette/di": "^3.0.6", "nette/finder": "^2.5.2|~3.0.0", "nette/http": "^3.0.7", @@ -25,27 +25,27 @@ "nette/schema": "^1.0", "nette/utils": "^3.2.1|~4.0.0", "php": "^8.0.2", - "symfony/config": "^6.0", - "symfony/translation": "^6.0" + "symfony/config": "^6.0|^7.0", + "symfony/translation": "^6.0|^7.0" }, "require-dev": { "doctrine/orm": "^2.8", "mockery/mockery": "^1.4", "nette/application": "^3.1.0", - "nette/bootstrap": "^3.0", + "nette/bootstrap": "^3.2.1", "nette/database": "^3.1.1", "nette/robot-loader": "^3.4.0|~4.0.0", "nette/tester": "^2.3.1", - "ninjify/nunjuck": "^0.3.0", + "ninjify/nunjuck": "^0.4.0", "ninjify/qa": "^0.13", "phpstan/phpstan": "^1.8", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-nette": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "psr/log": "^1.1", + "psr/log": "^1.1|^2.0|^3.0", "tracy/tracy": "^2.8" }, - "time": "2023-03-13T19:07:37+00:00", + "time": "2024-01-26T13:54:18+00:00", "type": "library", "extra": { "branch-alias": { @@ -76,7 +76,7 @@ ], "support": { "issues": "https://github.com/contributte/translation/issues", - "source": "https://github.com/contributte/translation/tree/v2.0.3" + "source": "https://github.com/contributte/translation/tree/v2.0.4" }, "funding": [ { @@ -702,38 +702,38 @@ }, { "name": "nette/di", - "version": "v3.1.8", - "version_normalized": "3.1.8.0", + "version": "v3.2.0", + "version_normalized": "3.2.0.0", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "adf475076dae08109dd0d57b1a48668d1d1bedf0" + "reference": "8140289e32e1b2bf2d8b5986bd92124b87fe6b2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/adf475076dae08109dd0d57b1a48668d1d1bedf0", - "reference": "adf475076dae08109dd0d57b1a48668d1d1bedf0", + "url": "https://api.github.com/repos/nette/di/zipball/8140289e32e1b2bf2d8b5986bd92124b87fe6b2f", + "reference": "8140289e32e1b2bf2d8b5986bd92124b87fe6b2f", "shasum": "" }, "require": { "ext-tokenizer": "*", "nette/neon": "^3.3 || ^4.0", - "nette/php-generator": "^3.5.4 || ^4.0", - "nette/robot-loader": "^3.2 || ~4.0.0", + "nette/php-generator": "^4.1.3", + "nette/robot-loader": "^4.0", "nette/schema": "^1.2.5", - "nette/utils": "^3.2.5 || ~4.0.0", - "php": "7.2 - 8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.3" }, "require-dev": { - "nette/tester": "^2.4", + "nette/tester": "^2.5.2", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, - "time": "2023-11-03T00:12:52+00:00", + "time": "2024-02-06T01:22:10+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "installation-source": "dist", @@ -771,7 +771,7 @@ ], "support": { "issues": "https://github.com/nette/di/issues", - "source": "https://github.com/nette/di/tree/v3.1.8" + "source": "https://github.com/nette/di/tree/v3.2.0" }, "install-path": "../nette/di" }, @@ -2008,17 +2008,17 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.56", - "version_normalized": "1.10.56.0", + "version": "1.10.57", + "version_normalized": "1.10.57.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa" + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", "shasum": "" }, "require": { @@ -2027,7 +2027,7 @@ "conflict": { "phpstan/phpstan-shim": "*" }, - "time": "2024-01-15T10:43:00+00:00", + "time": "2024-01-24T11:51:34+00:00", "bin": [ "phpstan", "phpstan.phar" @@ -2393,12 +2393,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "f81bd7cb90f5f30d3b246e342843ae905947158f" + "reference": "f987aa7e659fe7b118c5564974a6ef9e37b1dd0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f81bd7cb90f5f30d3b246e342843ae905947158f", - "reference": "f81bd7cb90f5f30d3b246e342843ae905947158f", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f987aa7e659fe7b118c5564974a6ef9e37b1dd0f", + "reference": "f987aa7e659fe7b118c5564974a6ef9e37b1dd0f", "shasum": "" }, "conflict": { @@ -2438,7 +2438,7 @@ "backpack/crud": "<3.4.9", "bacula-web/bacula-web": "<8.0.0.0-RC2-dev", "badaso/core": "<2.7", - "bagisto/bagisto": "<0.1.5", + "bagisto/bagisto": "<1.3.2", "barrelstrength/sprout-base-email": "<1.2.7", "barrelstrength/sprout-forms": "<3.9", "barryvdh/laravel-translation-manager": "<0.6.2", @@ -2452,12 +2452,13 @@ "bolt/bolt": "<3.7.2", "bolt/core": "<=4.2", "bottelet/flarepoint": "<2.2.1", + "bref/bref": "<2.1.13", "brightlocal/phpwhois": "<=4.2.5", "brotkrueml/codehighlight": "<2.7", "brotkrueml/schema": "<1.13.1|>=2,<2.5.1", "brotkrueml/typo3-matomo-integration": "<1.3.2", "buddypress/buddypress": "<7.2.1", - "bugsnag/bugsnag-laravel": "<2.0.2", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "bytefury/crater": "<6.0.2", "cachethq/cachet": "<2.5.1", "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.1,<4.1.4|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", @@ -2490,7 +2491,7 @@ "contao/managed-edition": "<=1.5", "corveda/phpsandbox": "<1.3.5", "cosenary/instagram": "<=2.3", - "craftcms/cms": "<=4.5.10", + "craftcms/cms": "<4.6.2", "croogo/croogo": "<4", "cuyz/valinor": "<0.12", "czproject/git-php": "<4.0.3", @@ -2505,7 +2506,7 @@ "desperado/xml-bundle": "<=0.1.7", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", "doctrine/annotations": "<1.2.7", - "doctrine/cache": "<1.3.2|>=1.4,<1.4.2", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": "<2.4.3|>=2.5,<2.5.1", "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4", "doctrine/doctrine-bundle": "<1.5.2", @@ -2548,7 +2549,7 @@ "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", - "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.06,<=2019.03.5.1", + "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", @@ -2600,7 +2601,7 @@ "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<2.2.1", "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<6.1.1", + "grumpydictator/firefly-iii": "<6.1.7", "gugoan/economizzer": "<=0.9.0.0-beta1", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", @@ -2622,7 +2623,7 @@ "ibexa/user": ">=4,<4.4.3", "icecoder/icecoder": "<=8.1", "idno/known": "<=1.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/auth": "<5.5.10", "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", @@ -2682,7 +2683,7 @@ "liftkit/database": "<2.13.2", "limesurvey/limesurvey": "<3.27.19", "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6", + "livewire/livewire": ">2.2.4,<2.2.6|>=3,<3.0.4", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", @@ -2698,7 +2699,7 @@ "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", "mautic/core": "<4.3", - "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "mediawiki/core": "<1.36.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", "melisplatform/melis-asset-manager": "<5.0.1", @@ -2786,7 +2787,7 @@ "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", "phpmyadmin/phpmyadmin": "<5.2.1", - "phpmyfaq/phpmyfaq": "<=3.1.7", + "phpmyfaq/phpmyfaq": "<3.2.5", "phpoffice/phpexcel": "<1.8", "phpoffice/phpspreadsheet": "<1.16", "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.34", @@ -2797,7 +2798,7 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<1.2.2", + "pimcore/admin-ui-classic-bundle": "<1.3.2", "pimcore/customer-management-framework-bundle": "<4.0.6", "pimcore/data-hub": "<1.2.4", "pimcore/demo": "<10.3", @@ -2821,7 +2822,7 @@ "prestashop/ps_facetedsearch": "<3.4.1", "prestashop/ps_linklist": "<3.1", "privatebin/privatebin": "<1.4", - "processwire/processwire": "<=3.0.200", + "processwire/processwire": "<=3.0.210", "propel/propel": ">=2.0.0.0-alpha1,<=2.0.0.0-alpha7", "propel/propel1": ">=1,<=1.7.1", "pterodactyl/panel": "<1.7", @@ -2862,13 +2863,13 @@ "shopxo/shopxo": "<2.2.6", "showdoc/showdoc": "<2.10.4", "silverstripe-australia/advancedreports": ">=1,<=2", - "silverstripe/admin": "<1.13.6", + "silverstripe/admin": "<1.13.19|>=2,<2.1.8", "silverstripe/assets": ">=1,<1.11.1", "silverstripe/cms": "<4.11.3", "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.13.14|>=5,<5.0.13", - "silverstripe/graphql": "<3.8.2|>=4,<4.1.3|>=4.2,<4.2.5|>=4.3,<4.3.4|>=5,<5.0.3", + "silverstripe/framework": "<4.13.39|>=5,<5.1.11", + "silverstripe/graphql": "<3.8.2|>=4,<4.3.7|>=5,<5.1.3", "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", "silverstripe/recipe-cms": ">=4.5,<4.5.3", "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", @@ -2901,13 +2902,14 @@ "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "ssddanbrown/bookstack": "<22.02.3", - "statamic/cms": "<4.36", + "statamic/cms": "<4.46", "stormpath/sdk": "<9.9.99", "studio-42/elfinder": "<2.1.62", "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", - "sulu/sulu": "<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8|==2.4.0.0-RC1|>=2.5,<2.5.10", + "sulu/sulu": "<1.6.44|>=2,<2.4.16|>=2.5,<2.5.12", "sumocoders/framework-user-bundle": "<1.4", + "superbig/craft-audit": "<3.0.2", "swag/paypal": "<5.4.4", "swiftmailer/swiftmailer": ">=4,<5.4.5", "swiftyedit/swiftyedit": "<1.2", @@ -3044,7 +3046,7 @@ "yourls/yourls": "<=1.8.2", "zencart/zencart": "<=1.5.7.0-beta", "zendesk/zendesk_api_client_php": "<2.2.11", - "zendframework/zend-cache": "<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", @@ -3076,11 +3078,11 @@ "zenstruck/collection": "<0.2.1", "zetacomponents/mail": "<1.8.2", "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": "<1.0.3", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", "zfr/zfr-oauth2-server-module": "<0.1.2", "zoujingli/thinkadmin": "<=6.1.53" }, - "time": "2024-01-17T21:04:22+00:00", + "time": "2024-02-05T21:04:15+00:00", "default-branch": true, "type": "metapackage", "notification-url": "https://packagist.org/downloads/", @@ -3852,17 +3854,17 @@ }, { "name": "symfony/cache", - "version": "v7.0.2", - "version_normalized": "7.0.2.0", + "version": "v7.0.3", + "version_normalized": "7.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "378e30a864c868d635353f103a5a5e7569f029ec" + "reference": "2207eceb2433d74df81232d97439bf508cb9e050" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/378e30a864c868d635353f103a5a5e7569f029ec", - "reference": "378e30a864c868d635353f103a5a5e7569f029ec", + "url": "https://api.github.com/repos/symfony/cache/zipball/2207eceb2433d74df81232d97439bf508cb9e050", + "reference": "2207eceb2433d74df81232d97439bf508cb9e050", "shasum": "" }, "require": { @@ -3896,7 +3898,7 @@ "symfony/messenger": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0" }, - "time": "2023-12-29T15:37:40+00:00", + "time": "2024-01-23T15:02:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3931,7 +3933,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.0.2" + "source": "https://github.com/symfony/cache/tree/v7.0.3" }, "funding": [ { @@ -4030,37 +4032,37 @@ }, { "name": "symfony/config", - "version": "v6.4.0", - "version_normalized": "6.4.0.0", + "version": "v7.0.3", + "version_normalized": "7.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e" + "reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5d33e0fb707d603330e0edfd4691803a1253572e", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e", + "url": "https://api.github.com/repos/symfony/config/zipball/86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16", + "reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, - "time": "2023-11-09T08:28:32+00:00", + "time": "2024-01-30T08:34:29+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4088,7 +4090,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.0" + "source": "https://github.com/symfony/config/tree/v7.0.3" }, "funding": [ { @@ -4178,17 +4180,17 @@ }, { "name": "symfony/filesystem", - "version": "v7.0.0", - "version_normalized": "7.0.0.0", + "version": "v7.0.3", + "version_normalized": "7.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", - "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", "shasum": "" }, "require": { @@ -4196,7 +4198,7 @@ "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, - "time": "2023-07-27T06:33:22+00:00", + "time": "2024-01-23T15:02:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4224,7 +4226,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.0" + "source": "https://github.com/symfony/filesystem/tree/v7.0.3" }, "funding": [ { @@ -4329,54 +4331,53 @@ }, { "name": "symfony/translation", - "version": "v6.4.2", - "version_normalized": "6.4.2.0", + "version": "v7.0.3", + "version_normalized": "7.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681" + "reference": "7285f25c7dcc74d9ec1232473114274604e50f00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", + "url": "https://api.github.com/repos/symfony/translation/zipball/7285f25c7dcc74d9ec1232473114274604e50f00", + "reference": "7285f25c7dcc74d9ec1232473114274604e50f00", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/http-kernel": "<5.4", + "symfony/http-kernel": "<6.4", "symfony/service-contracts": "<2.5", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/routing": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, - "time": "2023-12-18T09:25:29+00:00", + "time": "2024-01-29T15:41:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4407,7 +4408,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.2" + "source": "https://github.com/symfony/translation/tree/v7.0.3" }, "funding": [ { @@ -4508,17 +4509,17 @@ }, { "name": "symfony/var-exporter", - "version": "v7.0.2", - "version_normalized": "7.0.2.0", + "version": "v7.0.3", + "version_normalized": "7.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764" + "reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/345c62fefe92243c3a06fc0cc65f2ec1a47e0764", - "reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/1fb79308cb5fc2b44bff6e8af10a5af6812e05b8", + "reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8", "shasum": "" }, "require": { @@ -4527,7 +4528,7 @@ "require-dev": { "symfony/var-dumper": "^6.4|^7.0" }, - "time": "2023-12-27T08:42:13+00:00", + "time": "2024-01-23T15:02:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4565,7 +4566,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.0.2" + "source": "https://github.com/symfony/var-exporter/tree/v7.0.3" }, "funding": [ { diff --git a/site/vendor/composer/installed.php b/site/vendor/composer/installed.php index eb5bcfaa2..eaedea867 100644 --- a/site/vendor/composer/installed.php +++ b/site/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'spaze/michalspacek.cz', - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => 'de52d3a645caf288099870a2804d9ef5f395749c', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'contributte/translation' => array( - 'pretty_version' => 'v2.0.3', - 'version' => '2.0.3.0', - 'reference' => 'a8192980a8b48df411c3be68a22a082b75e41505', + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'reference' => 'ae4ff4e12095220161f2948e5cadc59f42a1936c', 'type' => 'library', 'install_path' => __DIR__ . '/../contributte/translation', 'aliases' => array(), @@ -128,9 +128,9 @@ 'dev_requirement' => false, ), 'nette/di' => array( - 'pretty_version' => 'v3.1.8', - 'version' => '3.1.8.0', - 'reference' => 'adf475076dae08109dd0d57b1a48668d1d1bedf0', + 'pretty_version' => 'v3.2.0', + 'version' => '3.2.0.0', + 'reference' => '8140289e32e1b2bf2d8b5986bd92124b87fe6b2f', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/di', 'aliases' => array(), @@ -323,9 +323,9 @@ 'dev_requirement' => true, ), 'phpstan/phpstan' => array( - 'pretty_version' => '1.10.56', - 'version' => '1.10.56.0', - 'reference' => '27816a01aea996191ee14d010f325434c0ee76fa', + 'pretty_version' => '1.10.57', + 'version' => '1.10.57.0', + 'reference' => '1627b1d03446904aaa77593f370c5201d2ecc34e', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), @@ -400,7 +400,7 @@ 'roave/security-advisories' => array( 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => 'f81bd7cb90f5f30d3b246e342843ae905947158f', + 'reference' => 'f987aa7e659fe7b118c5564974a6ef9e37b1dd0f', 'type' => 'metapackage', 'install_path' => NULL, 'aliases' => array( @@ -454,9 +454,9 @@ 'dev_requirement' => false, ), 'spaze/michalspacek.cz' => array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => 'de52d3a645caf288099870a2804d9ef5f395749c', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -541,9 +541,9 @@ ), ), 'symfony/cache' => array( - 'pretty_version' => 'v7.0.2', - 'version' => '7.0.2.0', - 'reference' => '378e30a864c868d635353f103a5a5e7569f029ec', + 'pretty_version' => 'v7.0.3', + 'version' => '7.0.3.0', + 'reference' => '2207eceb2433d74df81232d97439bf508cb9e050', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/cache', 'aliases' => array(), @@ -565,9 +565,9 @@ ), ), 'symfony/config' => array( - 'pretty_version' => 'v6.4.0', - 'version' => '6.4.0.0', - 'reference' => '5d33e0fb707d603330e0edfd4691803a1253572e', + 'pretty_version' => 'v7.0.3', + 'version' => '7.0.3.0', + 'reference' => '86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), @@ -583,9 +583,9 @@ 'dev_requirement' => false, ), 'symfony/filesystem' => array( - 'pretty_version' => 'v7.0.0', - 'version' => '7.0.0.0', - 'reference' => '7da8ea2362a283771478c5f7729cfcb43a76b8b7', + 'pretty_version' => 'v7.0.3', + 'version' => '7.0.3.0', + 'reference' => '2890e3a825bc0c0558526c04499c13f83e1b6b12', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), @@ -631,9 +631,9 @@ 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v6.4.2', - 'version' => '6.4.2.0', - 'reference' => 'a2ab2ec1a462e53016de8e8d5e8912bfd62ea681', + 'pretty_version' => 'v7.0.3', + 'version' => '7.0.3.0', + 'reference' => '7285f25c7dcc74d9ec1232473114274604e50f00', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), @@ -655,9 +655,9 @@ ), ), 'symfony/var-exporter' => array( - 'pretty_version' => 'v7.0.2', - 'version' => '7.0.2.0', - 'reference' => '345c62fefe92243c3a06fc0cc65f2ec1a47e0764', + 'pretty_version' => 'v7.0.3', + 'version' => '7.0.3.0', + 'reference' => '1fb79308cb5fc2b44bff6e8af10a5af6812e05b8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-exporter', 'aliases' => array(), diff --git a/site/vendor/contributte/translation/.github/workflows/main.yaml b/site/vendor/contributte/translation/.github/workflows/main.yaml index bfc62fb1e..3b34c4391 100644 --- a/site/vendor/contributte/translation/.github/workflows/main.yaml +++ b/site/vendor/contributte/translation/.github/workflows/main.yaml @@ -149,7 +149,7 @@ jobs: strategy: matrix: - php-version: [ "8.0", "8.1" ] + php-version: [ "8.0", "8.1", "8.2", "8.3" ] operating-system: [ "ubuntu-latest" ] composer-args: [ "" ] include: diff --git a/site/vendor/contributte/translation/composer.json b/site/vendor/contributte/translation/composer.json index ce35aa6d0..9b147fd8a 100644 --- a/site/vendor/contributte/translation/composer.json +++ b/site/vendor/contributte/translation/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": "^8.0.2", - "latte/latte": "^2.6|^3.0", + "latte/latte": "^2.6|^3.0.12", "nette/di": "^3.0.6", "nette/finder": "^2.5.2|~3.0.0", "nette/http": "^3.0.7", @@ -24,24 +24,24 @@ "nette/schema": "^1.0", "nette/routing": "^3.0", "nette/utils": "^3.2.1|~4.0.0", - "symfony/translation": "^6.0", - "symfony/config": "^6.0" + "symfony/translation": "^6.0|^7.0", + "symfony/config": "^6.0|^7.0" }, "require-dev": { "doctrine/orm": "^2.8", "mockery/mockery": "^1.4", "nette/application": "^3.1.0", - "nette/bootstrap": "^3.0", + "nette/bootstrap": "^3.2.1", "nette/database": "^3.1.1", "nette/robot-loader": "^3.4.0|~4.0.0", "nette/tester": "^2.3.1", - "ninjify/nunjuck": "^0.3.0", + "ninjify/nunjuck": "^0.4.0", "ninjify/qa": "^0.13", "phpstan/phpstan": "^1.8", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-nette": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "psr/log": "^1.1", + "psr/log": "^1.1|^2.0|^3.0", "tracy/tracy": "^2.8" }, "autoload": { diff --git a/site/vendor/contributte/translation/src/DI/TranslationExtension.php b/site/vendor/contributte/translation/src/DI/TranslationExtension.php index af3e569c7..4ad0568a9 100644 --- a/site/vendor/contributte/translation/src/DI/TranslationExtension.php +++ b/site/vendor/contributte/translation/src/DI/TranslationExtension.php @@ -82,6 +82,7 @@ public function getConfigSchema(): Schema 'translatorFactory' => Expect::string()->default(null), 'returnOriginalMessage' => Expect::bool()->default(true), 'autowired' => Expect::type('bool|array')->default(true), + 'latteFactory' => Expect::string(ILatteFactory::class)->nullable(), ]); } @@ -229,7 +230,7 @@ public function beforeCompile(): void $tracyPanel = $builder->getDefinition($this->prefix('tracyPanel')); } - $latteFactoryName = $builder->getByType(ILatteFactory::class); + $latteFactoryName = $this->config->latteFactory ? $builder->getByType($this->config->latteFactory) : null; if ($latteFactoryName !== null) { $iTranslator = $builder->getDefinitionByType(ITranslator::class); diff --git a/site/vendor/contributte/translation/src/Latte/TranslatorExtension.php b/site/vendor/contributte/translation/src/Latte/TranslatorExtension.php index f436eff91..159a39f81 100644 --- a/site/vendor/contributte/translation/src/Latte/TranslatorExtension.php +++ b/site/vendor/contributte/translation/src/Latte/TranslatorExtension.php @@ -9,7 +9,7 @@ use Latte\Compiler\Nodes\Php\ArgumentNode; use Latte\Compiler\Nodes\Php\Expression\ArrayNode; use Latte\Compiler\Nodes\Php\Expression\BinaryOpNode; -use Latte\Compiler\Nodes\Php\Expression\StaticCallNode; +use Latte\Compiler\Nodes\Php\Expression\StaticMethodCallNode; use Latte\Compiler\Nodes\Php\Expression\VariableNode; use Latte\Compiler\Nodes\Php\FilterNode; use Latte\Compiler\Nodes\Php\IdentifierNode; @@ -70,7 +70,7 @@ public function parseTranslate( $prefixProp = Helpers::createLatteProperty('Prefix'); - $messageNode = new StaticCallNode( + $messageNode = new StaticMethodCallNode( new NameNode('\Contributte\Translation\Helpers', NameNode::KindFullyQualified), new IdentifierNode('prefixMessage'), [ diff --git a/site/vendor/nette/di/composer.json b/site/vendor/nette/di/composer.json index 1c60badd0..f4782e7b2 100644 --- a/site/vendor/nette/di/composer.json +++ b/site/vendor/nette/di/composer.json @@ -15,16 +15,16 @@ } ], "require": { - "php": "7.2 - 8.3", + "php": "8.1 - 8.3", "ext-tokenizer": "*", "nette/neon": "^3.3 || ^4.0", - "nette/php-generator": "^3.5.4 || ^4.0", - "nette/robot-loader": "^3.2 || ~4.0.0", + "nette/php-generator": "^4.1.3", + "nette/robot-loader": "^4.0", "nette/schema": "^1.2.5", - "nette/utils": "^3.2.5 || ~4.0.0" + "nette/utils": "^4.0" }, "require-dev": { - "nette/tester": "^2.4", + "nette/tester": "^2.5.2", "tracy/tracy": "^2.9", "phpstan/phpstan": "^1.0" }, @@ -38,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } } } diff --git a/site/vendor/nette/di/contributing.md b/site/vendor/nette/di/contributing.md deleted file mode 100644 index 184152c02..000000000 --- a/site/vendor/nette/di/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/site/vendor/nette/di/readme.md b/site/vendor/nette/di/readme.md index 0769403c8..24d81e254 100644 --- a/site/vendor/nette/di/readme.md +++ b/site/vendor/nette/di/readme.md @@ -37,7 +37,7 @@ The recommended way to install is via Composer: composer require nette/di ``` -It requires PHP version 7.2 and supports PHP up to 8.3. +It requires PHP version 8.1 and supports PHP up to 8.3. Usage @@ -50,8 +50,8 @@ We have the object representing email: ```php class Mail { - public $subject; - public $message; + public string $subject; + public string $message; } ``` @@ -60,7 +60,7 @@ An object which can send emails: ```php interface Mailer { - function send(Mail $mail, $to); + function send(Mail $mail, string $to): void; } ``` @@ -69,7 +69,7 @@ A support for logging: ```php interface Logger { - function log($message); + function log(string $message): void; } ``` @@ -78,23 +78,25 @@ And finally, a class that provides sending newsletters: ```php class NewsletterManager { - private $mailer; - private $logger; + private Mailer $mailer; + private Logger $logger; - function __construct(Mailer $mailer, Logger $logger) + public function __construct(Mailer $mailer, Logger $logger) { $this->mailer = $mailer; $this->logger = $logger; } - function distribute(array $recipients) + public function distribute(array $recipients): void { $mail = new Mail; - ... + $mail->subject = '...'; + $mail->message = '...'; + foreach ($recipients as $recipient) { $this->mailer->send($mail, $recipient); } - $this->logger->log(...); + $this->logger->log('...'); } } ``` @@ -106,7 +108,7 @@ Also, we have a ability to implement own `Logger` or `Mailer`, like this: ```php class SendMailMailer implements Mailer { - function send(Mail $mail, $to) + public function send(Mail $mail, string $to): void { mail($to, $mail->subject, $mail->message); } @@ -114,14 +116,14 @@ class SendMailMailer implements Mailer class FileLogger implements Logger { - private $file; + private string $file; - function __construct($file) + public function __construct(string $file) { $this->file = $file; } - function log($message) + public function log(string $message): void { file_put_contents($this->file, $message . "\n", FILE_APPEND); } @@ -135,26 +137,26 @@ Container for our application might look like this: ```php class Container { - private $logger; - private $mailer; + private ?Logger $logger; + private ?Mailer $mailer; - function getLogger() + public function getLogger(): Logger { - if (!$this->logger) { + if (!isset($this->logger)) { $this->logger = new FileLogger('log.txt'); } return $this->logger; } - function getMailer() + public function getMailer(): Mailer { - if (!$this->mailer) { + if (!isset($this->mailer)) { $this->mailer = new SendMailMailer; } return $this->mailer; } - function createNewsletterManager() + public function createNewsletterManager(): NewsletterManager { return new NewsletterManager($this->getMailer(), $this->getLogger()); } @@ -213,7 +215,7 @@ The container will be generated only once and the code is stored in cache (in di During development it is useful to activate auto-refresh mode which automatically regenerate the container when any class or configuration file is changed. Just in the constructor `ContainerLoader` append `true` as the second argument: ```php -$loader = new Nette\DI\ContainerLoader(__DIR__ . '/temp', true); +$loader = new Nette\DI\ContainerLoader(__DIR__ . '/temp', autoRebuild: true); ``` @@ -244,9 +246,9 @@ Class of the service: ```php class NewsletterManager { - private $anotherService; + private AnotherService $anotherService; - public function setAnotherService(AnotherService $service) + public function setAnotherService(AnotherService $service): void { $this->anotherService = $service; } @@ -254,7 +256,7 @@ class NewsletterManager ... ``` -We can also add the `inject: yes` directive. This directive will enable automatic call of `inject*` methods and passing dependencies to public variables with `@inject` annotations: +We can also add the `inject: yes` directive. This directive will enable automatic call of `inject*` methods and passing dependencies to public variables with #[Inject] attribute: ```neon services: @@ -266,21 +268,23 @@ services: Dependency `Service1` will be passed by calling the `inject*` method, dependency `Service2` will be assigned to the `$service2` variable: ```php +use Nette\DI\Attributes\Inject; + class FooClass { - private $service1; + private Service1 $service1; // 1) inject* method: - public function injectService1(Service1 $service) + public function injectService1(Service1 $service): void { $this->service1 = $service1; } - // 2) Assign to the variable with the @inject annotation: + // 2) Assign to the variable with the #[Inject] attribute: - /** @inject @var Service2 */ - public $service2; + #[Inject] + public Service2 $service2; } ``` @@ -291,17 +295,14 @@ However, this method is not ideal, because the variable must be declared as publ Factories --------- -We can use factories generated from an interface. The interface must declare the returning type in the `@return` annotation of the method. Nette will generate a proper implementation of the interface. +We can use factories generated from an interface. The interface must declare the returning type of the method. Nette will generate a proper implementation of the interface. The interface must have exactly one method named `create`. Our factory interface could be declared in the following way: ```php -interface IBarFactory +interface BarFactory { - /** - * @return Bar - */ - public function create(); + function create(): Bar; } ``` @@ -310,7 +311,7 @@ The `create` method will instantiate an `Bar` with the following definition: ```php class Bar { - private $logger; + private Logger $logger; public function __construct(Logger $logger) { @@ -323,7 +324,7 @@ The factory will be registered in the `config.neon` file: ```neon services: - - IBarFactory + - BarFactory ``` Nette will check if the declared service is an interface. If yes, it will also generate the corresponding implementation of the factory. The definition can be also written in a more verbose form: @@ -331,7 +332,7 @@ Nette will check if the declared service is an interface. If yes, it will also g ```neon services: barFactory: - implement: IBarFactory + implement: BarFactory ``` This full definition allows us to declare additional configuration of the object using the `arguments` and `setup` sections, similarly as for all other services. @@ -341,14 +342,14 @@ In our code, we only have to obtain the factory instance and call the `create` m ```php class Foo { - private $barFactory; + private BarFactory $barFactory; - function __construct(IBarFactory $barFactory) + function __construct(BarFactory $barFactory) { $this->barFactory = $barFactory; } - function bar() + function bar(): void { $bar = $this->barFactory->create(); } diff --git a/site/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php b/site/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php index a50c0d6de..f8301b062 100644 --- a/site/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php +++ b/site/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php @@ -19,16 +19,9 @@ */ class ContainerPanel implements Tracy\IBarPanel { - use Nette\SmartObject; - - /** @var float|null */ - public static $compilationTime; - - /** @var Nette\DI\Container */ - private $container; - - /** @var float|null */ - private $elapsedTime; + public static ?float $compilationTime = null; + private Nette\DI\Container $container; + private ?float $elapsedTime; public function __construct(Container $container) @@ -57,7 +50,7 @@ public function getTab(): string */ public function getPanel(): string { - $methods = (function () { return $this->methods; })->bindTo($this->container, Container::class)(); + $methods = (fn() => $this->methods)->bindTo($this->container, Container::class)(); $services = []; foreach ($methods as $name => $foo) { $name = lcfirst(str_replace('__', '.', substr($name, 13))); @@ -65,7 +58,7 @@ public function getPanel(): string } ksort($services, SORT_NATURAL); - $propertyTags = (function () { return $this->tags; })->bindTo($this->container, $this->container)(); + $propertyTags = (fn() => $this->tags)->bindTo($this->container, $this->container)(); $tags = []; foreach ($propertyTags as $tag => $tmp) { foreach ($tmp as $service => $val) { @@ -77,8 +70,8 @@ public function getPanel(): string $container = $this->container; $rc = (new \ReflectionClass($this->container)); $file = $rc->getFileName(); - $instances = (function () { return $this->instances; })->bindTo($this->container, Container::class)(); - $wiring = (function () { return $this->wiring; })->bindTo($this->container, $this->container)(); + $instances = (fn() => $this->instances)->bindTo($this->container, Container::class)(); + $wiring = (fn() => $this->wiring)->bindTo($this->container, $this->container)(); $parameters = $rc->getMethod('getStaticParameters')->getDeclaringClass()->getName() === Container::class ? null : $container->getParameters(); diff --git a/site/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml b/site/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml index a54f7b138..b84022914 100644 --- a/site/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml +++ b/site/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml @@ -49,7 +49,7 @@ use Tracy\Helpers; $type): ?> - + $name" : Helpers::escapeHtml($name) ?> diff --git a/site/vendor/nette/di/src/DI/Autowiring.php b/site/vendor/nette/di/src/DI/Autowiring.php index b70cfe446..601f59ed7 100644 --- a/site/vendor/nette/di/src/DI/Autowiring.php +++ b/site/vendor/nette/di/src/DI/Autowiring.php @@ -9,27 +9,22 @@ namespace Nette\DI; -use Nette; - /** * Autowiring. */ class Autowiring { - use Nette\SmartObject; - - /** @var ContainerBuilder */ - private $builder; + private ContainerBuilder $builder; /** @var array[] type => services, used by getByType() */ - private $highPriority = []; + private array $highPriority = []; /** @var array[] type => services, used by findByType() */ - private $lowPriority = []; + private array $lowPriority = []; /** @var string[] of classes excluded from autowiring */ - private $excludedClasses = []; + private array $excludedClasses = []; public function __construct(ContainerBuilder $builder) @@ -40,7 +35,7 @@ public function __construct(ContainerBuilder $builder) /** * Resolves service name by type. - * @param bool $throw exception if service not found? + * @return ($throw is true ? string : ?string) * @throws MissingServiceException when not found * @throws ServiceCreationException when multiple found */ @@ -65,13 +60,13 @@ public function getByType(string $type, bool $throw = false): ?string } else { $list = $types[$type]; natsort($list); - $hint = count($list) === 2 && ($tmp = strpos($list[0], '.') xor strpos($list[1], '.')) + $hint = count($list) === 2 && ($tmp = str_contains($list[0], '.') xor str_contains($list[1], '.')) ? '. If you want to overwrite service ' . $list[$tmp ? 0 : 1] . ', give it proper name.' : ''; throw new ServiceCreationException(sprintf( "Multiple services of type $type found: %s%s", implode(', ', $list), - $hint + $hint, )); } } @@ -129,11 +124,11 @@ public function rebuild(): void foreach ($autowired as $k => $autowiredType) { if ($autowiredType === ContainerBuilder::ThisService) { $autowired[$k] = $type; - } elseif (!is_a($type, $autowiredType, true)) { + } elseif (!is_a($type, $autowiredType, allow_string: true)) { throw new ServiceCreationException(sprintf( "Incompatible class %s in autowiring definition of service '%s'.", $autowiredType, - $name + $name, )); } } @@ -145,7 +140,7 @@ public function rebuild(): void } elseif (is_array($autowired)) { $priority = false; foreach ($autowired as $autowiredType) { - if (is_a($parent, $autowiredType, true)) { + if (is_a($parent, $autowiredType, allow_string: true)) { if (empty($preferred[$parent]) && isset($this->highPriority[$parent])) { $this->lowPriority[$parent] = array_merge($this->lowPriority[$parent] ?? [], $this->highPriority[$parent]); $this->highPriority[$parent] = []; diff --git a/site/vendor/nette/di/src/DI/Compiler.php b/site/vendor/nette/di/src/DI/Compiler.php index 35e12ed7d..529ce6d81 100644 --- a/site/vendor/nette/di/src/DI/Compiler.php +++ b/site/vendor/nette/di/src/DI/Compiler.php @@ -18,33 +18,21 @@ */ class Compiler { - use Nette\SmartObject; - private const Services = 'services', Parameters = 'parameters', DI = 'di'; /** @var CompilerExtension[] */ - private $extensions = []; - - /** @var ContainerBuilder */ - private $builder; - - /** @var array */ - private $config = []; + private array $extensions = []; + private ContainerBuilder $builder; + private array $config = []; /** @var array [section => array[]] */ - private $configs = []; - - /** @var string */ - private $sources = ''; - - /** @var DependencyChecker */ - private $dependencies; - - /** @var string */ - private $className = 'Container'; + private array $configs = []; + private string $sources = ''; + private DependencyChecker $dependencies; + private string $className = 'Container'; public function __construct(?ContainerBuilder $builder = null) @@ -58,9 +46,8 @@ public function __construct(?ContainerBuilder $builder = null) /** * Add custom configurator extension. - * @return static */ - public function addExtension(?string $name, CompilerExtension $extension) + public function addExtension(?string $name, CompilerExtension $extension): static { if ($name === null) { $name = '_' . count($this->extensions); @@ -74,7 +61,7 @@ public function addExtension(?string $name, CompilerExtension $extension) throw new Nette\InvalidArgumentException(sprintf( "Name of extension '%s' has the same name as '%s' in a case-insensitive manner.", $name, - $nm + $nm, )); } } @@ -87,7 +74,7 @@ public function addExtension(?string $name, CompilerExtension $extension) public function getExtensions(?string $type = null): array { return $type - ? array_filter($this->extensions, function ($item) use ($type): bool { return $item instanceof $type; }) + ? array_filter($this->extensions, fn($item): bool => $item instanceof $type) : $this->extensions; } @@ -98,8 +85,7 @@ public function getContainerBuilder(): ContainerBuilder } - /** @return static */ - public function setClassName(string $className) + public function setClassName(string $className): static { $this->className = $className; return $this; @@ -108,9 +94,8 @@ public function setClassName(string $className) /** * Adds new configuration. - * @return static */ - public function addConfig(array $config) + public function addConfig(array $config): static { foreach ($config as $section => $data) { $this->configs[$section][] = $data; @@ -123,13 +108,12 @@ public function addConfig(array $config) /** * Adds new configuration from file. - * @return static */ - public function loadConfig(string $file, ?Config\Loader $loader = null) + public function loadConfig(string $file, ?Config\Loader $loader = null): static { $sources = $this->sources . "// source: $file\n"; $loader = $loader ?: new Config\Loader; - foreach ($loader->load($file, false) as $data) { + foreach ($loader->load($file, merge: false) as $data) { $this->addConfig($data); } @@ -151,9 +135,8 @@ public function getConfig(): array /** * Sets the names of dynamic parameters. - * @return static */ - public function setDynamicParameterNames(array $names) + public function setDynamicParameterNames(array $names): static { assert($this->extensions[self::Parameters] instanceof Extensions\ParametersExtension); $this->extensions[self::Parameters]->dynamicParams = $names; @@ -164,9 +147,8 @@ public function setDynamicParameterNames(array $names) /** * Adds dependencies to the list. * @param array $deps of ReflectionClass|\ReflectionFunctionAbstract|string - * @return static */ - public function addDependencies(array $deps) + public function addDependencies(array $deps): static { $this->dependencies->add(array_filter($deps)); return $this; @@ -182,8 +164,7 @@ public function exportDependencies(): array } - /** @return static */ - public function addExportedTag(string $tag) + public function addExportedTag(string $tag): static { if (isset($this->extensions[self::DI])) { assert($this->extensions[self::DI] instanceof Extensions\DIExtension); @@ -194,8 +175,7 @@ public function addExportedTag(string $tag) } - /** @return static */ - public function addExportedType(string $type) + public function addExportedType(string $type): static { if (isset($this->extensions[self::DI])) { assert($this->extensions[self::DI] instanceof Extensions\DIExtension); @@ -250,14 +230,14 @@ public function processExtensions(): void if ($extra = array_diff_key($this->extensions, $extensions, $first, [self::Services => 1])) { throw new Nette\DeprecatedException(sprintf( "Extensions '%s' were added while container was being compiled.", - implode("', '", array_keys($extra)) + implode("', '", array_keys($extra)), )); } elseif ($extra = key(array_diff_key($this->configs, $this->extensions))) { $hint = Nette\Utils\Helpers::getSuggestion(array_keys($this->extensions), $extra); throw new InvalidConfigurationException( sprintf("Found section '%s' in configuration, but corresponding extension is missing", $extra) - . ($hint ? ", did you mean '$hint'?" : '.') + . ($hint ? ", did you mean '$hint'?" : '.'), ); } } @@ -278,9 +258,8 @@ private function processBeforeCompile(): void /** * Merges and validates configurations against scheme. - * @return array|object */ - private function processSchema(Schema\Schema $schema, array $configs, $name = null) + private function processSchema(Schema\Schema $schema, array $configs, $name = null): array|object { $processor = new Schema\Processor; $processor->onNewContext[] = function (Schema\Context $context) use ($name) { diff --git a/site/vendor/nette/di/src/DI/CompilerExtension.php b/site/vendor/nette/di/src/DI/CompilerExtension.php index 0523448ad..8d623b891 100644 --- a/site/vendor/nette/di/src/DI/CompilerExtension.php +++ b/site/vendor/nette/di/src/DI/CompilerExtension.php @@ -17,23 +17,16 @@ */ abstract class CompilerExtension { - use Nette\SmartObject; - - /** @var Compiler */ - protected $compiler; - - /** @var string */ - protected $name; + protected Compiler $compiler; + protected string $name; /** @var array|object */ protected $config = []; - /** @var Nette\PhpGenerator\Closure */ - protected $initialization; + protected Nette\PhpGenerator\Closure $initialization; - /** @return static */ - public function setCompiler(Compiler $compiler, string $name) + public function setCompiler(Compiler $compiler, string $name): static { $this->initialization = new Nette\PhpGenerator\Closure; $this->compiler = $compiler; @@ -42,16 +35,8 @@ public function setCompiler(Compiler $compiler, string $name) } - /** - * @param array|object $config - * @return static - */ - public function setConfig($config) + public function setConfig(array|object $config): static { - if (!is_array($config) && !is_object($config)) { - throw new Nette\InvalidArgumentException; - } - $this->config = $config; return $this; } @@ -59,9 +44,8 @@ public function setConfig($config) /** * Returns extension configuration. - * @return array|object */ - public function getConfig() + public function getConfig(): array|object { return $this->config; } @@ -95,7 +79,7 @@ public function validateConfig(array $expected, ?array $config = null, ?string $ throw new Nette\DI\InvalidConfigurationException(sprintf( "Unknown configuration option '%s\u{a0}›\u{a0}%s'", $name, - $hint ? key($extra) : implode("', '{$name}\u{a0}›\u{a0}", array_keys($extra)) + $hint ? key($extra) : implode("', '{$name}\u{a0}›\u{a0}", array_keys($extra)), ) . ($hint ? ", did you mean '{$name}\u{a0}›\u{a0}{$hint}'?" : '.')); } @@ -154,7 +138,7 @@ public function getInitialization(): Nette\PhpGenerator\Closure */ public function prefix(string $id): string { - return substr_replace($id, $this->name . '.', substr($id, 0, 1) === '@' ? 1 : 0, 0); + return substr_replace($id, $this->name . '.', str_starts_with($id, '@') ? 1 : 0, 0); } diff --git a/site/vendor/nette/di/src/DI/Config/Adapters/NeonAdapter.php b/site/vendor/nette/di/src/DI/Config/Adapters/NeonAdapter.php index 319b3791e..9221e7edf 100644 --- a/site/vendor/nette/di/src/DI/Config/Adapters/NeonAdapter.php +++ b/site/vendor/nette/di/src/DI/Config/Adapters/NeonAdapter.php @@ -21,12 +21,8 @@ */ final class NeonAdapter implements Nette\DI\Config\Adapter { - use Nette\SmartObject; - private const PreventMergingSuffix = '!'; - - /** @var string */ - private $file; + private string $file; /** @@ -43,8 +39,10 @@ public function load(string $file): array $decoder = new Neon\Decoder; $node = $decoder->parseToNode($input); $traverser = new Neon\Traverser; - $node = $traverser->traverse($node, [$this, 'removeUnderscoreVisitor']); - $node = $traverser->traverse($node, [$this, 'convertAtSignVisitor']); + $node = $traverser->traverse($node, $this->firstClassCallableVisitor(...)); + $node = $traverser->traverse($node, $this->removeUnderscoreVisitor(...)); + $node = $traverser->traverse($node, $this->convertAtSignVisitor(...)); + $node = $traverser->traverse($node, $this->deprecatedParametersVisitor(...)); return $this->process((array) $node->toValue()); } @@ -54,12 +52,12 @@ public function process(array $arr): array { $res = []; foreach ($arr as $key => $val) { - if (is_string($key) && substr($key, -1) === self::PreventMergingSuffix) { + if (is_string($key) && str_ends_with($key, self::PreventMergingSuffix)) { if (!is_array($val) && $val !== null) { throw new Nette\DI\InvalidConfigurationException(sprintf( "Replacing operator is available only for arrays, item '%s' is not array (used in '%s')", $key, - $this->file + $this->file, )); } @@ -76,14 +74,14 @@ public function process(array $arr): array foreach ($this->process($val->attributes) as $st) { $tmp = new Statement( $tmp === null ? $st->getEntity() : [$tmp, ltrim(implode('::', (array) $st->getEntity()), ':')], - $st->arguments + $st->arguments, ); } $val = $tmp; } else { $tmp = $this->process([$val->value]); - if (is_string($tmp[0]) && strpos($tmp[0], '?') !== false) { + if (is_string($tmp[0]) && str_contains($tmp[0], '?')) { throw new Nette\DI\InvalidConfigurationException("Operator ? is deprecated in config file (used in '$this->file')"); } @@ -109,7 +107,7 @@ function (&$val): void { if ($val instanceof Statement) { $val = self::statementToEntity($val); } - } + }, ); return "# generated by Nette\n\n" . Neon\Neon::encode($data, Neon\Neon::BLOCK); } @@ -125,7 +123,7 @@ function (&$val): void { } elseif ($val instanceof Reference) { $val = '@' . $val->getValue(); } - } + }, ); $entity = $val->getEntity(); @@ -138,7 +136,7 @@ function (&$val): void { [ self::statementToEntity($entity[0]), new Neon\Entity('::' . $entity[1], $val->arguments), - ] + ], ); } elseif ($entity[0] instanceof Reference) { $entity = '@' . $entity[0]->getValue() . '::' . $entity[1]; @@ -151,8 +149,20 @@ function (&$val): void { } - /** @internal */ - public function removeUnderscoreVisitor(Neon\Node $node) + private function firstClassCallableVisitor(Neon\Node $node) + { + if ($node instanceof Neon\Node\EntityNode + && count($node->attributes) === 1 + && $node->attributes[0]->key === null + && $node->attributes[0]->value instanceof Neon\Node\LiteralNode + && $node->attributes[0]->value->value === '...' + ) { + $node->attributes[0]->value->value = Nette\DI\Resolver::getFirstClassCallable()[0]; + } + } + + + private function removeUnderscoreVisitor(Neon\Node $node) { if (!$node instanceof Neon\Node\EntityNode) { return; @@ -160,10 +170,12 @@ public function removeUnderscoreVisitor(Neon\Node $node) $index = false; foreach ($node->attributes as $i => $attr) { - if ($index) { - $attr->key = $attr->key ?? new Neon\Node\LiteralNode((string) $i); + if ($attr->key !== null) { + continue; } + $attr->key = $index ? new Neon\Node\LiteralNode((string) $i) : null; + if ($attr->value instanceof Neon\Node\LiteralNode && $attr->value->value === '_') { unset($node->attributes[$i]); $index = true; @@ -177,11 +189,10 @@ public function removeUnderscoreVisitor(Neon\Node $node) } - /** @internal */ - public function convertAtSignVisitor(Neon\Node $node) + private function convertAtSignVisitor(Neon\Node $node) { if ($node instanceof Neon\Node\StringNode) { - if (substr($node->value, 0, 2) === '@@') { + if (str_starts_with($node->value, '@@')) { trigger_error("There is no need to escape @ anymore, replace @@ with @ in: '$node->value' (used in $this->file)", E_USER_DEPRECATED); } else { $node->value = preg_replace('#^@#', '$0$0', $node->value); // escape @@ -190,9 +201,19 @@ public function convertAtSignVisitor(Neon\Node $node) } elseif ( $node instanceof Neon\Node\LiteralNode && is_string($node->value) - && substr($node->value, 0, 2) === '@@' + && str_starts_with($node->value, '@@') ) { trigger_error("There is no need to escape @ anymore, replace @@ with @ and put string in quotes: '$node->value' (used in $this->file)", E_USER_DEPRECATED); } } + + + private function deprecatedParametersVisitor(Neon\Node $node) + { + if (($node instanceof Neon\Node\StringNode || $node instanceof Neon\Node\LiteralNode) + && str_contains((string) $node->value, '%parameters%') + ) { + trigger_error('%parameters% is deprecated, use @container::getParameters() (in ' . $this->file . ')', E_USER_DEPRECATED); + } + } } diff --git a/site/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php b/site/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php index 17732810b..5471307b2 100644 --- a/site/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php +++ b/site/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php @@ -17,8 +17,6 @@ */ final class PhpAdapter implements Nette\DI\Config\Adapter { - use Nette\SmartObject; - /** * Reads configuration from PHP file. */ diff --git a/site/vendor/nette/di/src/DI/Config/Loader.php b/site/vendor/nette/di/src/DI/Config/Loader.php index 6273a8c73..8da694676 100644 --- a/site/vendor/nette/di/src/DI/Config/Loader.php +++ b/site/vendor/nette/di/src/DI/Config/Loader.php @@ -18,20 +18,15 @@ */ class Loader { - use Nette\SmartObject; - private const IncludesKey = 'includes'; - private $adapters = [ + private array $adapters = [ 'php' => Adapters\PhpAdapter::class, 'neon' => Adapters\NeonAdapter::class, ]; - - private $dependencies = []; - - private $loadedFiles = []; - - private $parameters = []; + private array $dependencies = []; + private array $loadedFiles = []; + private array $parameters = []; /** @@ -74,16 +69,6 @@ public function load(string $file, ?bool $merge = true): array } - /** @deprecated */ - public function save(array $data, string $file): void - { - trigger_error(__METHOD__ . "() is deprecated, use adapter's dump() method.", E_USER_DEPRECATED); - if (file_put_contents($file, $this->getAdapter($file)->dump($data)) === false) { - throw new Nette\IOException(sprintf("Cannot write file '%s'.", $file)); - } - } - - /** * Returns configuration files. */ @@ -106,10 +91,8 @@ public function expandIncludedFile(string $includedFile, string $mainFile): stri /** * Registers adapter for given file extension. - * @param string|Adapter $adapter - * @return static */ - public function addAdapter(string $extension, $adapter) + public function addAdapter(string $extension, string|Adapter $adapter): static { $this->adapters[strtolower($extension)] = $adapter; return $this; @@ -129,8 +112,7 @@ private function getAdapter(string $file): Adapter } - /** @return static */ - public function setParameters(array $params) + public function setParameters(array $params): static { $this->parameters = $params; return $this; diff --git a/site/vendor/nette/di/src/DI/Container.php b/site/vendor/nette/di/src/DI/Container.php index 2ecbf225f..6189e424b 100644 --- a/site/vendor/nette/di/src/DI/Container.php +++ b/site/vendor/nette/di/src/DI/Container.php @@ -17,8 +17,6 @@ */ class Container { - use Nette\SmartObject; - /** * @var mixed[] * @deprecated use Container::getParameter() or getParameters() @@ -26,25 +24,25 @@ class Container public $parameters = []; /** @var string[] services name => type (complete list of available services) */ - protected $types = []; + protected array $types = []; /** @var string[] alias => service name */ - protected $aliases = []; + protected array $aliases = []; /** @var array[] tag name => service name => tag value */ - protected $tags = []; + protected array $tags = []; /** @var array[] type => level => services */ - protected $wiring = []; + protected array $wiring = []; /** @var object[] service name => instance */ - private $instances = []; + private array $instances = []; /** @var array circular reference detector */ - private $creating; + private array $creating; /** @var array */ - private $methods; + private array $methods; public function __construct(array $params = []) @@ -52,7 +50,7 @@ public function __construct(array $params = []) $this->parameters = $params + $this->getStaticParameters(); $this->methods = array_flip(array_filter( get_class_methods($this), - function ($s) { return preg_match('#^createService.#', $s); } + fn($s) => preg_match('#^createService.#', $s), )); } @@ -63,12 +61,10 @@ public function getParameters(): array } - public function getParameter($key) + public function getParameter(string|int $key): mixed { if (!array_key_exists($key, $this->parameters)) { - $this->parameters[$key] = $this->preventDeadLock("%$key%", function () use ($key) { - return $this->getDynamicParameter($key); - }); + $this->parameters[$key] = $this->preventDeadLock("%$key%", fn() => $this->getDynamicParameter($key)); } return $this->parameters[$key]; } @@ -80,7 +76,7 @@ protected function getStaticParameters(): array } - protected function getDynamicParameter($key) + protected function getDynamicParameter(string|int $key): mixed { throw new Nette\InvalidStateException(sprintf("Parameter '%s' not found. Check if 'di › export › parameters' is enabled.", $key)); } @@ -89,9 +85,8 @@ protected function getDynamicParameter($key) /** * Adds the service to the container. * @param object $service service or its factory - * @return static */ - public function addService(string $name, object $service) + public function addService(string $name, object $service): static { $name = $this->aliases[$name] ?? $name; if (isset($this->instances[$name])) { @@ -102,18 +97,18 @@ public function addService(string $name, object $service) $rt = Nette\Utils\Type::fromReflection(new \ReflectionFunction($service)); $type = $rt ? Helpers::ensureClassType($rt, 'return type of closure') : ''; } else { - $type = get_class($service); + $type = $service::class; } if (!isset($this->methods[self::getMethodName($name)])) { $this->types[$name] = $type; - } elseif (($expectedType = $this->getServiceType($name)) && !is_a($type, $expectedType, true)) { + } elseif (($expectedType = $this->getServiceType($name)) && !is_a($type, $expectedType, allow_string: true)) { throw new Nette\InvalidArgumentException(sprintf( "Service '%s' must be instance of %s, %s.", $name, $expectedType, - $type ? "$type given" : 'add typehint to closure' + $type ? "$type given" : 'add typehint to closure', )); } @@ -180,8 +175,7 @@ public function getServiceType(string $name): string return $this->types[$name]; } elseif (isset($this->methods[$method])) { - $type = (new \ReflectionMethod($this, $method))->getReturnType(); - return $type ? $type->getName() : ''; + return (string) (new \ReflectionMethod($this, $method))->getReturnType(); } else { throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); @@ -217,7 +211,7 @@ public function isCreated(string $name): bool * Creates new instance of the service. * @throws MissingServiceException */ - public function createService(string $name, array $args = []): object + public function createService(string $name): object { $name = $this->aliases[$name] ?? $name; $method = self::getMethodName($name); @@ -226,16 +220,14 @@ public function createService(string $name, array $args = []): object throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); } - $service = $this->preventDeadLock($name, function () use ($callback, $args, $method) { - return $callback instanceof \Closure - ? $callback(...$args) - : $this->$method(...$args); - }); + $service = $this->preventDeadLock($name, fn() => $callback instanceof \Closure + ? $callback() + : $this->$method()); if (!is_object($service)) { throw new Nette\UnexpectedValueException(sprintf( "Unable to create service '$name', value returned by %s is not object.", - $callback instanceof \Closure ? 'closure' : "method $method()" + $callback instanceof \Closure ? 'closure' : "method $method()", )); } @@ -247,7 +239,7 @@ public function createService(string $name, array $args = []): object * Resolves service by type. * @template T of object * @param class-string $type - * @return ?T + * @return ($throw is true ? T : ?T) * @throws MissingServiceException */ public function getByType(string $type, bool $throw = true): ?object @@ -268,17 +260,17 @@ public function getByType(string $type, bool $throw = true): ?object foreach ($this->methods as $method => $foo) { $methodType = (new \ReflectionMethod(static::class, $method))->getReturnType()->getName(); - if (is_a($methodType, $type, true)) { + if (is_a($methodType, $type, allow_string: true)) { throw new MissingServiceException(sprintf( "Service of type %s is not autowired or is missing in di\u{a0}›\u{a0}export\u{a0}›\u{a0}types.", - $type + $type, )); } } throw new MissingServiceException(sprintf( 'Service of type %s not found. Did you add it to configuration file?', - $type + $type, )); } @@ -321,7 +313,7 @@ public function findByTag(string $tag): array } - private function preventDeadLock(string $key, \Closure $callback) + private function preventDeadLock(string $key, \Closure $callback): mixed { if (isset($this->creating[$key])) { throw new Nette\InvalidStateException(sprintf('Circular reference detected for: %s.', implode(', ', array_keys($this->creating)))); @@ -340,7 +332,6 @@ private function preventDeadLock(string $key, \Closure $callback) /** * Creates new instance using autowiring. - * @throws Nette\InvalidArgumentException */ public function createInstance(string $class, array $args = []): object { @@ -360,7 +351,7 @@ public function createInstance(string $class, array $args = []): object /** - * Calls all methods starting with with "inject" using autowiring. + * Calls all methods starting with "inject" using autowiring. */ public function callInjects(object $service): void { @@ -370,9 +361,8 @@ public function callInjects(object $service): void /** * Calls method using autowiring. - * @return mixed */ - public function callMethod(callable $function, array $args = []) + public function callMethod(callable $function, array $args = []): mixed { return $function(...$this->autowireArguments(Nette\Utils\Callback::toReflection($function), $args)); } @@ -380,11 +370,9 @@ public function callMethod(callable $function, array $args = []) private function autowireArguments(\ReflectionFunctionAbstract $function, array $args = []): array { - return Resolver::autowireArguments($function, $args, function (string $type, bool $single) { - return $single + return Resolver::autowireArguments($function, $args, fn(string $type, bool $single) => $single ? $this->getByType($type) - : array_map([$this, 'getService'], $this->findAutowired($type)); - }); + : array_map($this->getService(...), $this->findAutowired($type))); } diff --git a/site/vendor/nette/di/src/DI/ContainerBuilder.php b/site/vendor/nette/di/src/DI/ContainerBuilder.php index 8535575ff..92c60c134 100644 --- a/site/vendor/nette/di/src/DI/ContainerBuilder.php +++ b/site/vendor/nette/di/src/DI/ContainerBuilder.php @@ -18,8 +18,6 @@ */ class ContainerBuilder { - use Nette\SmartObject; - public const ThisService = 'self', ThisContainer = 'container'; @@ -34,22 +32,12 @@ class ContainerBuilder public $parameters = []; /** @var Definition[] */ - private $definitions = []; - - /** @var array of alias => service */ - private $aliases = []; - - /** @var Autowiring */ - private $autowiring; - - /** @var bool */ - private $needsResolve = true; - - /** @var bool */ - private $resolving = false; - - /** @var array */ - private $dependencies = []; + private array $definitions = []; + private array $aliases = []; + private Autowiring $autowiring; + private bool $needsResolve = true; + private bool $resolving = false; + private array $dependencies = []; public function __construct() @@ -89,7 +77,7 @@ public function addDefinition(?string $name, ?Definition $definition = null): De throw new Nette\InvalidStateException(sprintf( "Service '%s' has the same name as '%s' in a case-insensitive manner.", $name, - $nm + $nm, )); } } @@ -212,9 +200,8 @@ public function getAliases(): array /** * @param string[] $types - * @return static */ - public function addExcludedClasses(array $types) + public function addExcludedClasses(array $types): static { $this->needsResolve = true; $this->autowiring->addExcludedClasses($types); @@ -224,7 +211,7 @@ public function addExcludedClasses(array $types) /** * Resolves autowired service name by type. - * @param bool $throw exception if service doesn't exist? + * @return ($throw is true ? string : ?string) * @throws MissingServiceException */ public function getByType(string $type, bool $throw = false): ?string @@ -240,7 +227,7 @@ public function getByType(string $type, bool $throw = false): ?string */ public function getDefinitionByType(string $type): Definition { - return $this->getDefinition($this->getByType($type, true)); + return $this->getDefinition($this->getByType($type, throw: true)); } @@ -265,7 +252,7 @@ public function findByType(string $type): array $this->needResolved(); $found = []; foreach ($this->definitions as $name => $def) { - if (is_a($def->getType(), $type, true)) { + if (is_a($def->getType(), $type, allow_string: true)) { $found[$name] = $def; } } @@ -342,11 +329,9 @@ public function complete(): void /** * Adds item to the list of dependencies. - * @param \ReflectionClass|\ReflectionFunctionAbstract|string $dep - * @return static * @internal */ - public function addDependency($dep) + public function addDependency(\ReflectionClass|\ReflectionFunctionAbstract|string $dep): static { $this->dependencies[] = $dep; return $this; @@ -402,10 +387,10 @@ public function exportMeta(): array } - public static function literal(string $code, ?array $args = null): Nette\PhpGenerator\PhpLiteral + public static function literal(string $code, ?array $args = null): Nette\PhpGenerator\Literal { - return new Nette\PhpGenerator\PhpLiteral( - $args === null ? $code : (new Nette\PhpGenerator\Dumper)->format($code, ...$args) + return new Nette\PhpGenerator\Literal( + $args === null ? $code : (new Nette\PhpGenerator\Dumper)->format($code, ...$args), ); } diff --git a/site/vendor/nette/di/src/DI/ContainerLoader.php b/site/vendor/nette/di/src/DI/ContainerLoader.php index d8b04cb62..b1a2015a7 100644 --- a/site/vendor/nette/di/src/DI/ContainerLoader.php +++ b/site/vendor/nette/di/src/DI/ContainerLoader.php @@ -17,30 +17,20 @@ */ class ContainerLoader { - use Nette\SmartObject; - - /** @var bool */ - private $autoRebuild = false; - - /** @var string */ - private $tempDirectory; - - - public function __construct(string $tempDirectory, bool $autoRebuild = false) - { - $this->tempDirectory = $tempDirectory; - $this->autoRebuild = $autoRebuild; + public function __construct( + private string $tempDirectory, + private bool $autoRebuild = false, + ) { } /** * @param callable $generator function (Nette\DI\Compiler $compiler): string|null - * @param mixed $key */ - public function load(callable $generator, $key = null): string + public function load(callable $generator, mixed $key = null): string { $class = $this->getClassName($key); - if (!class_exists($class, false)) { + if (!class_exists($class, autoload: false)) { $this->loadFile($class, $generator); } @@ -48,10 +38,7 @@ public function load(callable $generator, $key = null): string } - /** - * @param mixed $key - */ - public function getClassName($key): string + public function getClassName(mixed $key): string { return 'Container_' . substr(md5(serialize($key)), 0, 10); } @@ -85,7 +72,7 @@ private function loadFile(string $class, callable $generator): void @unlink("$name.tmp"); // @ - file may not exist throw new Nette\IOException(sprintf("Unable to create file '%s'.", $name)); } elseif (function_exists('opcache_invalidate')) { - @opcache_invalidate($name, true); // @ can be restricted + @opcache_invalidate($name, force: true); // @ can be restricted } } } diff --git a/site/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php b/site/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php index 1cfc3561e..bd6c1a1a5 100644 --- a/site/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php +++ b/site/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php @@ -21,18 +21,16 @@ final class AccessorDefinition extends Definition { private const MethodGet = 'get'; - /** @var Reference|null */ - private $reference; + private ?Reference $reference = null; - /** @return static */ - public function setImplement(string $interface) + public function setImplement(string $interface): static { if (!interface_exists($interface)) { throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Interface '%s' not found.", $this->getName(), - $interface + $interface, )); } @@ -48,22 +46,17 @@ public function setImplement(string $interface) throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Interface %s must have just one non-static method get().", $this->getName(), - $interface + $interface, )); } elseif ($method->getNumberOfParameters()) { throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Method %s::get() must have no parameters.", $this->getName(), - $interface + $interface, )); } - try { - Helpers::ensureClassType(Type::fromReflection($method), "return type of $interface::get()"); - } catch (Nette\DI\ServiceCreationException $e) { - trigger_error($e->getMessage(), E_USER_DEPRECATED); - } - + Helpers::ensureClassType(Type::fromReflection($method), "return type of $interface::get()"); return parent::setType($interface); } @@ -74,16 +67,12 @@ public function getImplement(): ?string } - /** - * @param string|Reference $reference - * @return static - */ - public function setReference($reference) + public function setReference(string|Reference $reference): static { if ($reference instanceof Reference) { $this->reference = $reference; } else { - $this->reference = substr($reference, 0, 1) === '@' + $this->reference = str_starts_with($reference, '@') ? new Reference(substr($reference, 1)) : Reference::fromType($reference); } @@ -106,10 +95,12 @@ public function resolveType(Nette\DI\Resolver $resolver): void public function complete(Nette\DI\Resolver $resolver): void { if (!$this->reference) { - $interface = $this->getType(); - $method = new \ReflectionMethod($interface, self::MethodGet); - $type = Type::fromReflection($method) ?? Helpers::getReturnTypeAnnotation($method); - $this->setReference(Helpers::ensureClassType($type, "return type of $interface::get()")); + if (!$this->getType()) { + throw new Nette\DI\ServiceCreationException('Type is missing in definition of service.'); + } + + $method = new \ReflectionMethod($this->getType(), self::MethodGet); + $this->setReference(Type::fromReflection($method)->getSingleName()); } $this->reference = $resolver->normalizeReference($this->reference); @@ -121,13 +112,10 @@ public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGe $class = (new Nette\PhpGenerator\ClassType) ->addImplement($this->getType()); - $class->addProperty('container') - ->setPrivate(); - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); + ->addPromotedParameter('container') + ->setPrivate() + ->setType($generator->getClassName()); $rm = new \ReflectionMethod($this->getType(), self::MethodGet); diff --git a/site/vendor/nette/di/src/DI/Definitions/Definition.php b/site/vendor/nette/di/src/DI/Definitions/Definition.php index 1aaa7583d..ca96659b8 100644 --- a/site/vendor/nette/di/src/DI/Definitions/Definition.php +++ b/site/vendor/nette/di/src/DI/Definitions/Definition.php @@ -17,29 +17,19 @@ */ abstract class Definition { - use Nette\SmartObject; - - /** @var string|null */ - private $name; - - /** @var string|null class or interface name */ - private $type; - - /** @var array */ - private $tags = []; + private ?string $name = null; + private ?string $type = null; + private array $tags = []; /** @var bool|string[] */ - private $autowired = true; - - /** @var callable|null */ - private $notifier; + private bool|array $autowired = true; + private ?\Closure $notifier = null; /** - * @return static * @internal This is managed by ContainerBuilder and should not be called by user */ - final public function setName(string $name) + final public function setName(string $name): static { if ($this->name) { throw new Nette\InvalidStateException('Name already has been set.'); @@ -56,8 +46,7 @@ final public function getName(): ?string } - /** @return static */ - protected function setType(?string $type) + protected function setType(?string $type): static { if ($this->autowired && $this->notifier && $this->type !== $type) { ($this->notifier)(); @@ -69,7 +58,7 @@ protected function setType(?string $type) throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Class or interface '%s' not found.", $this->name, - $type + $type, )); } else { $this->type = Nette\DI\Helpers::normalizeClass($type); @@ -85,8 +74,7 @@ final public function getType(): ?string } - /** @return static */ - final public function setTags(array $tags) + final public function setTags(array $tags): static { $this->tags = $tags; return $this; @@ -99,29 +87,20 @@ final public function getTags(): array } - /** - * @param mixed $attr - * @return static - */ - final public function addTag(string $tag, $attr = true) + final public function addTag(string $tag, mixed $attr = true): static { $this->tags[$tag] = $attr; return $this; } - /** @return mixed */ - final public function getTag(string $tag) + final public function getTag(string $tag): mixed { return $this->tags[$tag] ?? null; } - /** - * @param bool|string|string[] $state - * @return static - */ - final public function setAutowired($state = true) + final public function setAutowired(bool|string|array $state = true): static { if ($this->notifier && $this->autowired !== $state) { ($this->notifier)(); @@ -129,20 +108,19 @@ final public function setAutowired($state = true) $this->autowired = is_string($state) || is_array($state) ? (array) $state - : (bool) $state; + : $state; return $this; } /** @return bool|string[] */ - final public function getAutowired() + final public function getAutowired(): bool|array { return $this->autowired; } - /** @return static */ - public function setExported(bool $state = true) + public function setExported(bool $state = true): static { return $this->addTag('nette.exported', $state); } @@ -172,7 +150,7 @@ abstract public function complete(Nette\DI\Resolver $resolver): void; abstract public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGenerator $generator): void; - final public function setNotifier(?callable $notifier): void + final public function setNotifier(?\Closure $notifier): void { $this->notifier = $notifier; } @@ -195,22 +173,6 @@ public function getClass(): ?string } - /** @deprecated Use '$def instanceof Nette\DI\Definitions\ImportedDefinition' */ - public function isDynamic(): bool - { - trigger_error(sprintf('Service %s: %s() is deprecated, use "instanceof ImportedDefinition".', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return false; - } - - - /** @deprecated Use Nette\DI\Definitions\FactoryDefinition or AccessorDefinition */ - public function getImplement(): ?string - { - trigger_error(sprintf('Service %s: %s() is deprecated.', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return null; - } - - /** @deprecated Use getAutowired() */ public function isAutowired() { diff --git a/site/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php b/site/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php index 4916ffd6d..7c2e69caa 100644 --- a/site/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php +++ b/site/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php @@ -13,7 +13,6 @@ use Nette\DI\Helpers; use Nette\DI\ServiceCreationException; use Nette\PhpGenerator as Php; -use Nette\Utils\Reflection; use Nette\Utils\Type; @@ -24,11 +23,7 @@ final class FactoryDefinition extends Definition { private const MethodCreate = 'create'; - /** @var array */ - public $parameters = []; - - /** @var Definition */ - private $resultDefinition; + private Definition $resultDefinition; public function __construct() @@ -37,14 +32,13 @@ public function __construct() } - /** @return static */ - public function setImplement(string $interface) + public function setImplement(string $interface): static { if (!interface_exists($interface)) { throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Interface '%s' not found.", $this->getName(), - $interface + $interface, )); } @@ -54,16 +48,11 @@ public function setImplement(string $interface) throw new Nette\InvalidArgumentException(sprintf( "Service '%s': Interface %s must have just one non-static method create().", $this->getName(), - $interface + $interface, )); } - try { - Helpers::ensureClassType(Type::fromReflection($method), "return type of $interface::create()"); - } catch (Nette\DI\ServiceCreationException $e) { - trigger_error($e->getMessage(), E_USER_DEPRECATED); - } - + Helpers::ensureClassType(Type::fromReflection($method), "return type of $interface::create()"); return parent::setType($interface); } @@ -74,14 +63,13 @@ public function getImplement(): ?string } - final public function getResultType(): ?string + public function getResultType(): ?string { return $this->resultDefinition->getType(); } - /** @return static */ - public function setResultDefinition(Definition $definition) + public function setResultDefinition(Definition $definition): static { $this->resultDefinition = $definition; return $this; @@ -95,46 +83,13 @@ public function getResultDefinition(): Definition } - /** @deprecated */ - public function setParameters(array $params) - { - if ($params) { - $old = $new = []; - foreach ($params as $k => $v) { - $tmp = explode(' ', is_int($k) ? $v : $k); - $old[] = '%' . end($tmp) . '%'; - $new[] = '$' . end($tmp); - } - - trigger_error(sprintf( - "Service '%s': Option 'parameters' is deprecated and should be removed. The %s should be replaced with %s in configuration.", - $this->getName(), - implode(', ', $old), - implode(', ', $new) - ), E_USER_DEPRECATED); - } - - $this->parameters = $params; - return $this; - } - - - /** @deprecated */ - public function getParameters(): array - { - return $this->parameters; - } - - public function resolveType(Nette\DI\Resolver $resolver): void { - $interface = $this->getType(); - if (!$interface) { + if (!$this->getType()) { throw new ServiceCreationException('Type is missing in definition of service.'); } - $method = new \ReflectionMethod($interface, self::MethodCreate); - $type = Type::fromReflection($method) ?? Helpers::getReturnTypeAnnotation($method); + $type = Type::fromReflection(new \ReflectionMethod($this->getType(), self::MethodCreate)); $resultDef = $this->resultDefinition; try { @@ -144,15 +99,15 @@ public function resolveType(Nette\DI\Resolver $resolver): void throw $e; } - $resultDef->setType(Helpers::ensureClassType($type, "return type of $interface::create()")); + $resultDef->setType($type->getSingleName()); $resolver->resolveDefinition($resultDef); } - if ($type && !$type->allows($resultDef->getType())) { + if (!$type->allows($resultDef->getType())) { throw new ServiceCreationException(sprintf( 'Factory for %s cannot create incompatible %s type.', $type, - $resultDef->getType() + $resultDef->getType(), )); } } @@ -163,10 +118,7 @@ public function complete(Nette\DI\Resolver $resolver): void $resultDef = $this->resultDefinition; if ($resultDef instanceof ServiceDefinition) { - if (!$this->parameters) { - $this->completeParameters($resolver); - } - + $this->completeParameters($resolver); $this->convertArguments($resultDef->getCreator()->arguments); foreach ($resultDef->getSetup() as $setup) { $this->convertArguments($setup->arguments); @@ -200,16 +152,15 @@ private function completeParameters(Nette\DI\Resolver $resolver): void } foreach ($method->getParameters() as $param) { - $methodType = Type::fromReflection($param); if (isset($ctorParams[$param->name])) { $ctorParam = $ctorParams[$param->name]; $ctorType = Type::fromReflection($ctorParam); - if ($ctorType && !$ctorType->allows((string) $methodType)) { + if ($ctorType && !$ctorType->allows((string) Type::fromReflection($param))) { throw new ServiceCreationException(sprintf( "Type of \$%s in %s::create() doesn't match type in %s constructor.", $param->name, $interface, - $class + $class, )); } @@ -217,29 +168,20 @@ private function completeParameters(Nette\DI\Resolver $resolver): void } elseif (!$this->resultDefinition->getSetup()) { // [param1, param2] => '$param1, $param2' - $stringifyParams = function (array $params): string { - return implode(', ', array_map( - function (string $param) { return '$' . $param; }, - $params - )); - }; + $stringifyParams = fn(array $params): string => implode( + ', ', + array_map(fn(string $param) => '$' . $param, $params), + ); $ctorParamsKeys = array_keys($ctorParams); $hint = Nette\Utils\Helpers::getSuggestion($ctorParamsKeys, $param->name); throw new ServiceCreationException(sprintf( 'Cannot implement %s::create(): factory method parameters (%s) are not matching %s::__construct() parameters (%s).', $interface, - $stringifyParams(array_map(function (\ReflectionParameter $param) { return $param->name; }, $method->getParameters())), + $stringifyParams(array_map(fn(\ReflectionParameter $param) => $param->name, $method->getParameters())), $class, - $stringifyParams($ctorParamsKeys) + $stringifyParams($ctorParamsKeys), ) . ($hint ? " Did you mean to use '\${$hint}' in factory method?" : '')); } - - $paramDef = $methodType . ' ' . $param->name; - if ($param->isDefaultValueAvailable()) { - $this->parameters[$paramDef] = Reflection::getParameterDefaultValue($param); - } else { - $this->parameters[] = $paramDef; - } } } @@ -259,13 +201,10 @@ public function generateMethod(Php\Method $method, Nette\DI\PhpGenerator $genera $class = (new Php\ClassType) ->addImplement($this->getType()); - $class->addProperty('container') - ->setPrivate(); - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); + ->addPromotedParameter('container') + ->setPrivate() + ->setType($generator->getClassName()); $methodCreate = $class->addMethod(self::MethodCreate); $this->resultDefinition->generateMethod($methodCreate, $generator); @@ -275,8 +214,8 @@ public function generateMethod(Php\Method $method, Nette\DI\PhpGenerator $genera $rm = new \ReflectionMethod($this->getType(), self::MethodCreate); $methodCreate - ->setParameters($generator->convertParameters($this->parameters)) - ->setReturnType((string) (Type::fromReflection($rm) ?? $this->getResultType())) + ->setParameters(array_map((new Php\Factory)->fromParameterReflection(...), $rm->getParameters())) + ->setReturnType((string) Type::fromReflection($rm)) ->setBody($body); $method->setBody('return new class ($this) ' . $class . ';'); diff --git a/site/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php b/site/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php index 2002f6f71..eb97fbcbe 100644 --- a/site/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php +++ b/site/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php @@ -18,8 +18,7 @@ */ final class ImportedDefinition extends Definition { - /** @return static */ - public function setType(?string $type) + public function setType(?string $type): static { return parent::setType($type); } @@ -40,15 +39,7 @@ public function generateMethod(Nette\PhpGenerator\Method $method, PhpGenerator $ $method->setReturnType('void') ->setBody( 'throw new Nette\\DI\\ServiceCreationException(?);', - ["Unable to create imported service '{$this->getName()}', it must be added using addService()"] + ["Unable to create imported service '{$this->getName()}', it must be added using addService()"], ); } - - - /** @deprecated use '$def instanceof ImportedDefinition' */ - public function isDynamic(): bool - { - trigger_error(sprintf('Service %s: %s() is deprecated, use "instanceof ImportedDefinition".', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return true; - } } diff --git a/site/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php b/site/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php index 0412ff7ab..f4fee5d66 100644 --- a/site/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php +++ b/site/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php @@ -18,14 +18,11 @@ final class LocatorDefinition extends Definition { /** @var Reference[] */ - private $references = []; + private array $references = []; + private ?string $tagged = null; - /** @var string|null */ - private $tagged; - - /** @return static */ - public function setImplement(string $interface) + public function setImplement(string $interface): static { if (!interface_exists($interface)) { throw new Nette\InvalidArgumentException(sprintf("Service '%s': Interface '%s' not found.", $this->getName(), $interface)); @@ -42,19 +39,21 @@ public function setImplement(string $interface) || (preg_match('#^(get|create)[A-Z]#', $method->name) && $method->getNumberOfParameters() === 0) )) { throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Method %s::%s() does not meet the requirements: is create(\$name), get(\$name), create*() or get*() and is non-static.", + "Service '%s': Method %s::%s() does not meet the requirements: is create*(), get*() or get(\$name) and is non-static.", $this->getName(), $interface, - $method->name + $method->name, )); } if ($method->getNumberOfParameters() === 0) { - try { - Nette\DI\Helpers::ensureClassType(Nette\Utils\Type::fromReflection($method), "return type of $interface::$method->name()", true); - } catch (Nette\DI\ServiceCreationException $e) { - trigger_error($e->getMessage(), E_USER_DEPRECATED); - } + Nette\DI\Helpers::ensureClassType( + Nette\Utils\Type::fromReflection($method), + "return type of $interface::$method->name()", + allowNullable: true, + ); + } elseif (str_starts_with($method->name, 'create')) { + trigger_error(sprintf("Service '%s': Method %s::create(\$name) is deprecated, use createFoo().", $this->getName(), $interface), E_USER_DEPRECATED); } } @@ -68,12 +67,11 @@ public function getImplement(): ?string } - /** @return static */ - public function setReferences(array $references) + public function setReferences(array $references): static { $this->references = []; foreach ($references as $name => $ref) { - $this->references[$name] = substr($ref, 0, 1) === '@' + $this->references[$name] = str_starts_with($ref, '@') ? new Reference(substr($ref, 1)) : Reference::fromType($ref); } @@ -89,8 +87,7 @@ public function getReferences(): array } - /** @return static */ - public function setTagged(?string $tagged) + public function setTagged(?string $tagged): static { $this->tagged = $tagged; return $this; @@ -118,8 +115,8 @@ public function complete(Nette\DI\Resolver $resolver): void "Service '%s': duplicated tag '%s' with value '%s'.", $this->getName(), $this->tagged, - $tag - ), E_USER_NOTICE); + $tag, + )); } $this->references[$tag] = new Reference($name); @@ -137,13 +134,10 @@ public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGe $class = (new Nette\PhpGenerator\ClassType) ->addImplement($this->getType()); - $class->addProperty('container') - ->setPrivate(); - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); + ->addPromotedParameter('container') + ->setPrivate() + ->setType($generator->getClassName()); foreach ((new \ReflectionClass($this->getType()))->getMethods() as $rm) { preg_match('#^(get|create)(.*)#', $rm->name, $m); @@ -154,7 +148,7 @@ public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGe ->setReturnType((string) Nette\Utils\Type::fromReflection($rm)); if (!$name) { - $class->addProperty('mapping', array_map(function ($item) { return $item->getValue(); }, $this->references)) + $class->addProperty('mapping', array_map(fn($item) => $item->getValue(), $this->references)) ->setPrivate(); $methodInner->setBody('if (!isset($this->mapping[$name])) { diff --git a/site/vendor/nette/di/src/DI/Definitions/Reference.php b/site/vendor/nette/di/src/DI/Definitions/Reference.php index d7b94584e..25625dec7 100644 --- a/site/vendor/nette/di/src/DI/Definitions/Reference.php +++ b/site/vendor/nette/di/src/DI/Definitions/Reference.php @@ -9,28 +9,23 @@ namespace Nette\DI\Definitions; -use Nette; - /** * Reference to service. Either by name or by type or reference to the 'self' service. */ final class Reference { - use Nette\SmartObject; - public const Self = 'self'; /** @deprecated use Reference::Self */ public const SELF = self::Self; - /** @var string */ - private $value; + private string $value; - public static function fromType(string $value): self + public static function fromType(string $value): static { - if (strpos($value, '\\') === false) { + if (!str_contains($value, '\\')) { $value = '\\' . $value; } @@ -52,13 +47,13 @@ public function getValue(): string public function isName(): bool { - return strpos($this->value, '\\') === false && $this->value !== self::Self; + return !str_contains($this->value, '\\') && $this->value !== self::Self; } public function isType(): bool { - return strpos($this->value, '\\') !== false; + return str_contains($this->value, '\\'); } diff --git a/site/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php b/site/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php index ede56644b..6cec76a86 100644 --- a/site/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php +++ b/site/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php @@ -22,11 +22,12 @@ */ final class ServiceDefinition extends Definition { - /** @var Statement */ - private $creator; + use Nette\SmartObject; + + private Statement $creator; /** @var Statement[] */ - private $setup = []; + private array $setup = []; public function __construct() @@ -35,8 +36,7 @@ public function __construct() } - /** @return static */ - public function setType(?string $type) + public function setType(?string $type): static { return parent::setType($type); } @@ -44,10 +44,8 @@ public function setType(?string $type) /** * Alias for setCreator() - * @param string|array|Definition|Reference|Statement $factory - * @return static */ - public function setFactory($factory, array $args = []) + public function setFactory(string|array|Definition|Reference|Statement $factory, array $args = []): static { return $this->setCreator($factory, $args); } @@ -62,11 +60,7 @@ public function getFactory(): Statement } - /** - * @param string|array|Definition|Reference|Statement $creator - * @return static - */ - public function setCreator($creator, array $args = []) + public function setCreator(string|array|Definition|Reference|Statement $creator, array $args = []): static { $this->creator = $creator instanceof Statement ? $creator @@ -81,23 +75,20 @@ public function getCreator(): Statement } - /** @return string|array|Definition|Reference|null */ - public function getEntity() + public function getEntity(): string|array|Definition|Reference|null { return $this->creator->getEntity(); } - /** @return static */ - public function setArguments(array $args = []) + public function setArguments(array $args = []): static { $this->creator->arguments = $args; return $this; } - /** @return static */ - public function setArgument($key, $value) + public function setArgument($key, $value): static { $this->creator->arguments[$key] = $value; return $this; @@ -106,9 +97,8 @@ public function setArgument($key, $value) /** * @param Statement[] $setup - * @return static */ - public function setSetup(array $setup) + public function setSetup(array $setup): static { foreach ($setup as &$entity) { if (!$entity instanceof Statement) { @@ -129,11 +119,7 @@ public function getSetup(): array } - /** - * @param string|array|Definition|Reference|Statement $entity - * @return static - */ - public function addSetup($entity, array $args = []) + public function addSetup(string|array|Definition|Reference|Statement $entity, array $args = []): static { $entity = $entity instanceof Statement ? $entity diff --git a/site/vendor/nette/di/src/DI/Definitions/Statement.php b/site/vendor/nette/di/src/DI/Definitions/Statement.php index ec2a035cd..cd80f6d44 100644 --- a/site/vendor/nette/di/src/DI/Definitions/Statement.php +++ b/site/vendor/nette/di/src/DI/Definitions/Statement.php @@ -10,7 +10,6 @@ namespace Nette\DI\Definitions; use Nette; -use Nette\Utils\Strings; /** @@ -22,17 +21,11 @@ final class Statement implements Nette\Schema\DynamicParameter { use Nette\SmartObject; - /** @var array */ - public $arguments; + public array $arguments; + private string|array|Definition|Reference|null $entity; - /** @var string|array|Definition|Reference|null */ - private $entity; - - /** - * @param string|array|Definition|Reference|null $entity - */ - public function __construct($entity, array $arguments = []) + public function __construct(string|array|Definition|Reference|null $entity, array $arguments = []) { if ( $entity !== null @@ -50,13 +43,13 @@ public function __construct($entity, array $arguments = []) } // normalize Class::method to [Class, method] - if (is_string($entity) && Strings::contains($entity, '::') && !Strings::contains($entity, '?')) { + if (is_string($entity) && str_contains($entity, '::') && !str_contains($entity, '?')) { $entity = explode('::', $entity, 2); } - if (is_string($entity) && substr($entity, 0, 1) === '@') { // normalize @service to Reference + if (is_string($entity) && str_starts_with($entity, '@')) { // normalize @service to Reference $entity = new Reference(substr($entity, 1)); - } elseif (is_array($entity) && is_string($entity[0]) && substr($entity[0], 0, 1) === '@') { + } elseif (is_array($entity) && is_string($entity[0]) && str_starts_with($entity[0], '@')) { $entity[0] = new Reference(substr($entity[0], 1)); } @@ -65,8 +58,7 @@ public function __construct($entity, array $arguments = []) } - /** @return string|array|Definition|Reference|null */ - public function getEntity() + public function getEntity(): string|array|Definition|Reference|null { return $this->entity; } diff --git a/site/vendor/nette/di/src/DI/DependencyChecker.php b/site/vendor/nette/di/src/DI/DependencyChecker.php index 89f03ae51..4b143af19 100644 --- a/site/vendor/nette/di/src/DI/DependencyChecker.php +++ b/site/vendor/nette/di/src/DI/DependencyChecker.php @@ -11,7 +11,6 @@ use Nette; use Nette\Utils\Reflection; -use Nette\Utils\Type; use ReflectionClass; use ReflectionMethod; @@ -21,22 +20,19 @@ */ class DependencyChecker { - use Nette\SmartObject; - public const Version = 1; /** @deprecated use DependencyChecker::Version */ public const VERSION = self::Version; - /** @var array of ReflectionClass|\ReflectionFunctionAbstract|string */ - private $dependencies = []; + /** @var array */ + private array $dependencies = []; /** * Adds dependencies to the list. - * @return static */ - public function add(array $deps) + public function add(array $deps): static { $this->dependencies = array_merge($this->dependencies, $deps); return $this; @@ -67,7 +63,7 @@ public function export(): array $functions[] = rtrim(Reflection::toString($dep), '()'); } else { - throw new Nette\InvalidStateException(sprintf('Unexpected dependency %s', gettype($dep))); + throw new Nette\InvalidStateException(sprintf('Unexpected dependency %s', get_debug_type($dep))); } } @@ -89,7 +85,7 @@ public static function isExpired( array &$phpFiles, array $classes, array $functions, - string $hash + string $hash, ): bool { try { @@ -99,7 +95,7 @@ public static function isExpired( return $version !== self::Version || $files !== $currentFiles || ($phpFiles !== $origPhpFiles && $hash !== self::calculateHash($classes, $functions)); - } catch (\ReflectionException $e) { + } catch (\ReflectionException) { return true; } } @@ -125,8 +121,8 @@ class_uses($name), $name, $prop->name, $prop->getDocComment(), - (string) Type::fromReflection($prop), - PHP_VERSION_ID >= 80000 ? count($prop->getAttributes(Attributes\Inject::class)) : null, + (string) $prop->getType(), + count($prop->getAttributes(Attributes\Inject::class)), ]; } } @@ -138,7 +134,7 @@ class_uses($name), $method->name, $method->getDocComment(), self::hashParameters($method), - (string) Type::fromReflection($method), + (string) $method->getReturnType(), ]; } } @@ -146,8 +142,10 @@ class_uses($name), $flip = array_flip($classes); foreach ($functions as $name) { - if (strpos($name, '::')) { - $method = new ReflectionMethod($name); + if (str_contains($name, '::')) { + $method = PHP_VERSION_ID < 80300 + ? new ReflectionMethod($name) + : ReflectionMethod::createFromMethodName($name); $class = $method->getDeclaringClass(); if (isset($flip[$class->name])) { continue; @@ -164,7 +162,7 @@ class_uses($name), $uses, $method->getDocComment(), self::hashParameters($method), - (string) Type::fromReflection($method), + (string) $method->getReturnType(), ]; } @@ -178,10 +176,10 @@ private static function hashParameters(\ReflectionFunctionAbstract $method): arr foreach ($method->getParameters() as $param) { $res[] = [ $param->name, - (string) Type::fromReflection($param), + (string) $param->getType(), $param->isVariadic(), $param->isDefaultValueAvailable() - ? is_object($tmp = Reflection::getParameterDefaultValue($param)) ? ['object' => get_class($tmp)] : ['value' => $tmp] + ? is_object($tmp = Reflection::getParameterDefaultValue($param)) ? ['object' => $tmp::class] : ['value' => $tmp] : null, ]; } diff --git a/site/vendor/nette/di/src/DI/DynamicParameter.php b/site/vendor/nette/di/src/DI/DynamicParameter.php index 682576594..8c3ae486e 100644 --- a/site/vendor/nette/di/src/DI/DynamicParameter.php +++ b/site/vendor/nette/di/src/DI/DynamicParameter.php @@ -15,6 +15,6 @@ /** * @internal */ -final class DynamicParameter extends Nette\PhpGenerator\PhpLiteral implements Nette\Schema\DynamicParameter +final class DynamicParameter extends Nette\PhpGenerator\Literal implements Nette\Schema\DynamicParameter { } diff --git a/site/vendor/nette/di/src/DI/Extensions/ConstantsExtension.php b/site/vendor/nette/di/src/DI/Extensions/ConstantsExtension.php deleted file mode 100644 index 3d34fb5f3..000000000 --- a/site/vendor/nette/di/src/DI/Extensions/ConstantsExtension.php +++ /dev/null @@ -1,28 +0,0 @@ -getConfig() as $name => $value) { - $this->initialization->addBody('define(?, ?);', [$name, $value]); - } - } -} diff --git a/site/vendor/nette/di/src/DI/Extensions/DIExtension.php b/site/vendor/nette/di/src/DI/Extensions/DIExtension.php index 0551187d4..5b789cffa 100644 --- a/site/vendor/nette/di/src/DI/Extensions/DIExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/DIExtension.php @@ -18,17 +18,10 @@ */ final class DIExtension extends Nette\DI\CompilerExtension { - /** @var array */ - public $exportedTags = []; - - /** @var array */ - public $exportedTypes = []; - - /** @var bool */ - private $debugMode; - - /** @var float */ - private $time; + public array $exportedTags = []; + public array $exportedTypes = []; + private bool $debugMode; + private float $time; public function __construct(bool $debugMode = false) @@ -37,39 +30,33 @@ public function __construct(bool $debugMode = false) $this->time = microtime(true); $this->config = new class { - /** @var ?bool */ - public $debugger; + public ?bool $debugger = null; /** @var string[] */ - public $excluded = []; - - /** @var ?string */ - public $parentClass; - - /** @var object */ - public $export; + public array $excluded = []; + public ?string $parentClass = null; + public object $export; }; $this->config->export = new class { - /** @var bool */ - public $parameters = true; + public bool $parameters = true; /** @var string[]|bool|null */ - public $tags = true; + public array|bool|null $tags = true; /** @var string[]|bool|null */ - public $types = true; + public array|bool|null $types = true; }; } - public function loadConfiguration() + public function loadConfiguration(): void { $builder = $this->getContainerBuilder(); $builder->addExcludedClasses($this->config->excluded); } - public function afterCompile(Nette\PhpGenerator\ClassType $class) + public function afterCompile(Nette\PhpGenerator\ClassType $class): void { if ($this->config->parentClass) { $class->setExtends($this->config->parentClass); @@ -119,7 +106,7 @@ private function restrictTypes(Nette\PhpGenerator\ClassType $class): void $prop = $class->getProperty('wiring'); $prop->setValue(array_intersect_key( $prop->getValue(), - $this->exportedTypes + (is_array($option) ? array_flip($option) : []) + $this->exportedTypes + (is_array($option) ? array_flip($option) : []), )); } @@ -130,7 +117,7 @@ private function enableTracyIntegration(): void $this->initialization->addBody($this->getContainerBuilder()->formatPhp('?;', [ new Nette\DI\Definitions\Statement( '@Tracy\Bar::addPanel', - [new Nette\DI\Definitions\Statement(Nette\Bridges\DITracy\ContainerPanel::class)] + [new Nette\DI\Definitions\Statement(Nette\Bridges\DITracy\ContainerPanel::class)], ), ])); } diff --git a/site/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php b/site/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php index 17667d498..7afa70339 100644 --- a/site/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php @@ -25,7 +25,7 @@ public function getConfigSchema(): Nette\Schema\Schema 'setup' => Expect::list(), 'tags' => Expect::array(), 'inject' => Expect::bool(), - ]) + ]), ); } @@ -68,7 +68,7 @@ public function addSetups(string $type, array $setups): void public function addTags(string $type, array $tags): void { - $tags = Nette\Utils\Arrays::normalize($tags, true); + $tags = Nette\Utils\Arrays::normalize($tags, filling: true); foreach ($this->findByType($type) as $def) { $def->setTags($def->getTags() + $tags); } @@ -77,9 +77,10 @@ public function addTags(string $type, array $tags): void private function findByType(string $type): array { - return array_filter($this->getContainerBuilder()->getDefinitions(), function (Definitions\Definition $def) use ($type): bool { - return is_a($def->getType(), $type, true) - || ($def instanceof Definitions\FactoryDefinition && is_a($def->getResultType(), $type, true)); - }); + return array_filter( + $this->getContainerBuilder()->getDefinitions(), + fn(Definitions\Definition $def): bool => is_a($def->getType(), $type, true) + || ($def instanceof Definitions\FactoryDefinition && is_a($def->getResultType(), $type, allow_string: true)), + ); } } diff --git a/site/vendor/nette/di/src/DI/Extensions/DefinitionSchema.php b/site/vendor/nette/di/src/DI/Extensions/DefinitionSchema.php index 77146ebd0..94e566134 100644 --- a/site/vendor/nette/di/src/DI/Extensions/DefinitionSchema.php +++ b/site/vendor/nette/di/src/DI/Extensions/DefinitionSchema.php @@ -23,10 +23,7 @@ */ class DefinitionSchema implements Schema { - use Nette\SmartObject; - - /** @var Nette\DI\ContainerBuilder */ - private $builder; + private Nette\DI\ContainerBuilder $builder; public function __construct(Nette\DI\ContainerBuilder $builder) @@ -51,7 +48,6 @@ public function complete($def, Context $context) } } - $def = $this->expandParameters($def); $type = $this->sniffType(end($context->path), $def); $def = $this->getSchema($type)->complete($def, $context); if ($def) { @@ -98,44 +94,18 @@ public function normalize($def, Context $context) } elseif (!is_array($def) || isset($def[0], $def[1])) { return ['create' => $def]; - } elseif (is_array($def)) { + } else { // back compatibility if (isset($def['factory']) && !isset($def['create'])) { $def['create'] = $def['factory']; unset($def['factory']); } - - if ( - isset($def['class']) - && !isset($def['type']) - && !isset($def['dynamic']) - && !isset($def['imported']) - ) { + if (isset($def['class']) && !isset($def['type']) && !isset($def['imported'])) { $def[isset($def['create']) ? 'type' : 'create'] = $def['class']; unset($def['class']); } - foreach (['class' => 'type', 'dynamic' => 'imported'] as $alias => $original) { - if (array_key_exists($alias, $def)) { - if (array_key_exists($original, $def)) { - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Options '%s' and '%s' are aliases, use only '%s'.", - $alias, - $original, - $original - )); - } - - trigger_error(sprintf("Service '%s': option '$alias' should be changed to '$original'.", end($context->path)), E_USER_DEPRECATED); - $def[$original] = $def[$alias]; - unset($def[$alias]); - } - } - return $def; - - } else { - throw new Nette\DI\InvalidConfigurationException('Unexpected format of service definition'); } } @@ -149,7 +119,7 @@ private function sniffType($key, array $def): string { if (is_string($key)) { $name = preg_match('#^@[\w\\\\]+$#D', $key) - ? $this->builder->getByType(substr($key, 1), false) + ? $this->builder->getByType(substr($key, 1)) : $key; if ($name && $this->builder->hasDefinition($name)) { @@ -177,20 +147,6 @@ private function sniffType($key, array $def): string } - private function expandParameters(array $config): array - { - $params = $this->builder->parameters; - if (isset($config['parameters'])) { - foreach ((array) $config['parameters'] as $k => $v) { - $v = explode(' ', is_int($k) ? $v : $k); - $params[end($v)] = $this->builder::literal('$' . end($v)); - } - } - - return Nette\DI\Helpers::expand($config, $params); - } - - private static function getSchema(string $type): Schema { static $cache; @@ -241,7 +197,6 @@ private static function getFactorySchema(): Schema 'implement' => Expect::string(), 'arguments' => Expect::array(), 'setup' => Expect::listOf('callable|Nette\DI\Definitions\Statement|array:1'), - 'parameters' => Expect::array(), 'references' => Expect::array(), 'tagged' => Expect::string(), 'inject' => Expect::bool(), diff --git a/site/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php b/site/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php index c527f85ac..591ad4fda 100644 --- a/site/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php @@ -23,7 +23,7 @@ public function getConfigSchema(): Nette\Schema\Schema } - public function loadConfiguration() + public function loadConfiguration(): void { foreach ($this->getConfig() as $name => $class) { if (is_int($name)) { @@ -35,10 +35,10 @@ public function loadConfiguration() [$class, $args] = [$class->getEntity(), $class->arguments]; } - if (!is_a($class, Nette\DI\CompilerExtension::class, true)) { + if (!is_a($class, Nette\DI\CompilerExtension::class, allow_string: true)) { throw new Nette\DI\InvalidConfigurationException(sprintf( "Extension '%s' not found or is not Nette\\DI\\CompilerExtension descendant.", - $class + $class, )); } diff --git a/site/vendor/nette/di/src/DI/Extensions/InjectExtension.php b/site/vendor/nette/di/src/DI/Extensions/InjectExtension.php index d32082c46..91948615f 100644 --- a/site/vendor/nette/di/src/DI/Extensions/InjectExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/InjectExtension.php @@ -66,6 +66,9 @@ private function updateDefinition(Definitions\ServiceDefinition $def): void } } + if ($builder) { + self::checkType($class, $property, $type, $builder); + } array_unshift($setups, $inject); } @@ -93,17 +96,15 @@ public static function getInjectMethods(string $class): array { $classes = []; foreach (get_class_methods($class) as $name) { - if (substr($name, 0, 6) === 'inject') { + if (str_starts_with($name, 'inject')) { $classes[$name] = (new \ReflectionMethod($class, $name))->getDeclaringClass()->name; } } $methods = array_keys($classes); - uksort($classes, function (string $a, string $b) use ($classes, $methods): int { - return $classes[$a] === $classes[$b] - ? array_search($a, $methods, true) <=> array_search($b, $methods, true) - : (is_a($classes[$a], $classes[$b], true) ? 1 : -1); - }); + uksort($classes, fn(string $a, string $b): int => $classes[$a] === $classes[$b] + ? array_search($a, $methods, strict: true) <=> array_search($b, $methods, strict: true) + : (is_a($classes[$a], $classes[$b], allow_string: true) ? 1 : -1)); return array_keys($classes); } @@ -116,16 +117,10 @@ public static function getInjectProperties(string $class): array { $res = []; foreach ((new \ReflectionClass($class))->getProperties() as $rp) { - $name = $rp->getName(); - $hasAttr = PHP_VERSION_ID >= 80000 && $rp->getAttributes(DI\Attributes\Inject::class); + $hasAttr = $rp->getAttributes(DI\Attributes\Inject::class); if ($hasAttr || DI\Helpers::parseAnnotation($rp, 'inject') !== null) { - if (!$rp->isPublic() || $rp->isStatic()) { - trigger_error(sprintf('Property %s for injection must be public and non-static.', Reflection::toString($rp)), E_USER_WARNING); - continue; - } - - if (PHP_VERSION_ID >= 80100 && $rp->isReadOnly()) { - throw new Nette\InvalidStateException(sprintf('Property %s for injection must not be readonly.', Reflection::toString($rp))); + if (!$rp->isPublic() || $rp->isStatic() || $rp->isReadOnly()) { + throw new Nette\InvalidStateException(sprintf('Property %s for injection must not be static, readonly and must be public.', Reflection::toString($rp))); } $type = Nette\Utils\Type::fromReflection($rp); @@ -144,21 +139,34 @@ public static function getInjectProperties(string $class): array /** - * Calls all methods starting with with "inject" using autowiring. - * @param object $service + * Calls all methods starting with "inject" using autowiring. */ - public static function callInjects(DI\Container $container, $service): void + public static function callInjects(DI\Container $container, object $service): void { - if (!is_object($service)) { - throw new Nette\InvalidArgumentException(sprintf('Service must be object, %s given.', gettype($service))); - } - - foreach (self::getInjectMethods(get_class($service)) as $method) { + foreach (self::getInjectMethods($service::class) as $method) { $container->callMethod([$service, $method]); } - foreach (self::getInjectProperties(get_class($service)) as $property => $type) { + foreach (self::getInjectProperties($service::class) as $property => $type) { + self::checkType($service, $property, $type, $container); $service->$property = $container->getByType($type); } } + + + private static function checkType( + object|string $class, + string $name, + ?string $type, + DI\Container|DI\ContainerBuilder $container, + ): void + { + if (!$container->getByType($type, throw: false)) { + throw new Nette\DI\MissingServiceException(sprintf( + 'Service of type %s required by %s not found. Did you add it to configuration file?', + $type, + Reflection::toString(new \ReflectionProperty($class, $name)), + )); + } + } } diff --git a/site/vendor/nette/di/src/DI/Extensions/ParametersExtension.php b/site/vendor/nette/di/src/DI/Extensions/ParametersExtension.php index 76b33ce12..c9fdc73dd 100644 --- a/site/vendor/nette/di/src/DI/Extensions/ParametersExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/ParametersExtension.php @@ -22,13 +22,11 @@ final class ParametersExtension extends Nette\DI\CompilerExtension { /** @var string[] */ - public $dynamicParams = []; + public array $dynamicParams = []; /** @var string[][] */ - public $dynamicValidators = []; - - /** @var array */ - private $compilerConfig; + public array $dynamicValidators = []; + private array $compilerConfig; public function __construct(array &$compilerConfig) @@ -37,7 +35,7 @@ public function __construct(array &$compilerConfig) } - public function loadConfiguration() + public function loadConfiguration(): void { $builder = $this->getContainerBuilder(); $params = $this->config; @@ -45,16 +43,12 @@ public function loadConfiguration() $params[$key] = new DynamicParameter('$this->getParameter(' . var_export($key, true) . ')'); } - $builder->parameters = Helpers::expand($params, $params, true); - - // expand all except 'services' - $slice = array_diff_key($this->compilerConfig, ['services' => 1]); - $slice = Helpers::expand($slice, $builder->parameters); - $this->compilerConfig = $slice + $this->compilerConfig; + $builder->parameters = Helpers::expand($params, $params, recursive: true); + $this->compilerConfig = Helpers::expand($this->compilerConfig, $builder->parameters); } - public function afterCompile(Nette\PhpGenerator\ClassType $class) + public function afterCompile(Nette\PhpGenerator\ClassType $class): void { $builder = $this->getContainerBuilder(); $dynamicParams = array_fill_keys($this->dynamicParams, true); @@ -62,7 +56,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) $value = [$value]; array_walk_recursive($value, function ($val) use (&$dynamicParams, $key): void { if ($val instanceof DynamicParameter) { - $dynamicParams[$key] = $dynamicParams[$key] ?? true; + $dynamicParams[$key] ??= true; } elseif ($val instanceof Nette\DI\Definitions\Statement) { $dynamicParams[$key] = false; } @@ -73,33 +67,36 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) ->addBody('return ?;', [array_diff_key($builder->parameters, $dynamicParams)]); $class->addMember($method); - $dynamicParams = array_keys($dynamicParams, true, true); if (!$dynamicParams) { return; } $resolver = new Nette\DI\Resolver($builder); $generator = new Nette\DI\PhpGenerator($builder); - $method = Method::from([Container::class, 'getDynamicParameter']); - $class->addMember($method); - $method->addBody('switch (true) {'); - foreach ($dynamicParams as $key) { + $method = $class->inheritMethod('getDynamicParameter'); + $method->addBody('return match($key) {'); + foreach ($dynamicParams as $key => $foo) { $value = Helpers::expand($this->config[$key] ?? null, $builder->parameters); - $value = $generator->convertArguments($resolver->completeArguments(Helpers::filterArguments([$value])))[0]; - $method->addBody("\tcase \$key === ?: return ?;", [$key, $value]); + try { + $value = $generator->convertArguments($resolver->completeArguments(Helpers::filterArguments([$value])))[0]; + $method->addBody("\t? => ?,", [$key, $value]); + } catch (Nette\DI\ServiceCreationException $e) { + $method->addBody("\t? => throw new Nette\\DI\\ServiceCreationException(?),", [$key, $e->getMessage()]); + } } - $method->addBody("\tdefault: return parent::getDynamicParameter(\$key);\n};"); + $method->addBody("\tdefault => parent::getDynamicParameter(\$key),\n};"); - $method = Method::from([Container::class, 'getParameters']); - $class->addMember($method); - $method->addBody('array_map([$this, \'getParameter\'], ?);', [$dynamicParams]); - $method->addBody('return parent::getParameters();'); + if ($preload = array_keys($dynamicParams, true, true)) { + $method = $class->inheritMethod('getParameters'); + $method->addBody('array_map($this->getParameter(...), ?);', [$preload]); + $method->addBody('return parent::getParameters();'); + } foreach ($this->dynamicValidators as [$param, $expected, $path]) { if ($param instanceof DynamicParameter) { $this->initialization->addBody( 'Nette\Utils\Validators::assert(?, ?, ?);', - [$param, $expected, "dynamic parameter used in '" . implode("\u{a0}›\u{a0}", $path) . "'"] + [$param, $expected, "dynamic parameter used in '" . implode("\u{a0}›\u{a0}", $path) . "'"], ); } } diff --git a/site/vendor/nette/di/src/DI/Extensions/PhpExtension.php b/site/vendor/nette/di/src/DI/Extensions/PhpExtension.php deleted file mode 100644 index 117bdfe84..000000000 --- a/site/vendor/nette/di/src/DI/Extensions/PhpExtension.php +++ /dev/null @@ -1,54 +0,0 @@ -getConfig() as $name => $value) { - if ($value === null) { - continue; - - } elseif ($name === 'include_path') { - $this->initialization->addBody('set_include_path(?);', [str_replace(';', PATH_SEPARATOR, $value)]); - - } elseif ($name === 'ignore_user_abort') { - $this->initialization->addBody('ignore_user_abort(?);', [$value]); - - } elseif ($name === 'max_execution_time') { - $this->initialization->addBody('set_time_limit(?);', [$value]); - - } elseif ($name === 'date.timezone') { - $this->initialization->addBody('date_default_timezone_set(?);', [$value]); - - } elseif (function_exists('ini_set')) { - $this->initialization->addBody('ini_set(?, ?);', [$name, $value === false ? '0' : (string) $value]); - - } elseif (ini_get($name) !== (string) $value) { - throw new Nette\NotSupportedException('Required function ini_set() is disabled.'); - } - } - } -} diff --git a/site/vendor/nette/di/src/DI/Extensions/SearchExtension.php b/site/vendor/nette/di/src/DI/Extensions/SearchExtension.php index 34b6daea1..eb872534d 100644 --- a/site/vendor/nette/di/src/DI/Extensions/SearchExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/SearchExtension.php @@ -20,11 +20,8 @@ */ final class SearchExtension extends Nette\DI\CompilerExtension { - /** @var array */ - private $classes = []; - - /** @var string */ - private $tempDir; + private array $classes = []; + private string $tempDir; public function __construct(string $tempDir) @@ -43,21 +40,20 @@ public function getConfigSchema(): Nette\Schema\Schema 'extends' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), 'implements' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), 'exclude' => Expect::structure([ + 'files' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), 'classes' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), 'extends' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), 'implements' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), ]), 'tags' => Expect::array(), - ]) - )->before(function ($val) { - return is_string($val['in'] ?? null) + ]), + )->before(fn($val) => is_string($val['in'] ?? null) ? ['default' => $val] - : $val; - }); + : $val); } - public function loadConfiguration() + public function loadConfiguration(): void { foreach (array_filter($this->config) as $name => $batch) { if (!is_dir($batch->in)) { @@ -65,7 +61,7 @@ public function loadConfiguration() "Option '%s\u{a0}›\u{a0}%s\u{a0}›\u{a0}in' must be valid directory name, '%s' given.", $this->name, $name, - $batch->in + $batch->in, )); } @@ -78,15 +74,16 @@ public function loadConfiguration() public function findClasses(\stdClass $config): array { + $exclude = $config->exclude; $robot = new RobotLoader; $robot->setTempDirectory($this->tempDir); $robot->addDirectory($config->in); $robot->acceptFiles = $config->files ?: ['*.php']; + $robot->ignoreDirs = array_merge($robot->ignoreDirs, $exclude->files); $robot->reportParseErrors(false); $robot->refresh(); $classes = array_unique(array_keys($robot->getIndexedClasses())); - $exclude = $config->exclude; $acceptRE = self::buildNameRegexp($config->classes); $rejectRE = self::buildNameRegexp($exclude->classes); $acceptParent = array_merge($config->extends, $config->implements); @@ -97,7 +94,7 @@ public function findClasses(\stdClass $config): array if (!class_exists($class) && !interface_exists($class) && !trait_exists($class)) { throw new Nette\InvalidStateException(sprintf( 'Class %s was found, but it cannot be loaded by autoloading.', - $class + $class, )); } @@ -107,12 +104,12 @@ public function findClasses(\stdClass $config): array || ($rc->isInterface() && count($methods = $rc->getMethods()) === 1 - && $methods[0]->name === 'create') + && in_array($methods[0]->name, ['get', 'create'], true)) ) && (!$acceptRE || preg_match($acceptRE, $rc->name)) && (!$rejectRE || !preg_match($rejectRE, $rc->name)) - && (!$acceptParent || Arrays::some($acceptParent, function ($nm) use ($rc) { return $rc->isSubclassOf($nm); })) - && (!$rejectParent || Arrays::every($rejectParent, function ($nm) use ($rc) { return !$rc->isSubclassOf($nm); })) + && (!$acceptParent || Arrays::some($acceptParent, fn($nm) => $rc->isSubclassOf($nm))) + && (!$rejectParent || Arrays::every($rejectParent, fn($nm) => !$rc->isSubclassOf($nm))) ) { $found[] = $rc->name; } @@ -122,7 +119,7 @@ public function findClasses(\stdClass $config): array } - public function beforeCompile() + public function beforeCompile(): void { $builder = $this->getContainerBuilder(); @@ -133,10 +130,14 @@ public function beforeCompile() } foreach ($this->classes as $class => $tags) { - $def = class_exists($class) - ? $builder->addDefinition(null)->setType($class) - : $builder->addFactoryDefinition(null)->setImplement($class); - $def->setTags(Arrays::normalize($tags, true)); + if (class_exists($class)) { + $def = $builder->addDefinition(null)->setType($class); + } elseif (method_exists($class, 'create')) { + $def = $builder->addFactoryDefinition(null)->setImplement($class); + } else { + $def = $builder->addAccessorDefinition(null)->setImplement($class); + } + $def->setTags(Arrays::normalize($tags, filling: true)); } } @@ -144,8 +145,8 @@ public function beforeCompile() private static function buildNameRegexp(array $masks): ?string { $res = []; - foreach ((array) $masks as $mask) { - $mask = (strpos($mask, '\\') === false ? '**\\' : '') . $mask; + foreach ($masks as $mask) { + $mask = (str_contains($mask, '\\') ? '' : '**\\') . $mask; $mask = preg_quote($mask, '#'); $mask = str_replace('\*\*\\\\', '(.*\\\\)?', $mask); $mask = str_replace('\\\\\*\*', '(\\\\.*)?', $mask); diff --git a/site/vendor/nette/di/src/DI/Extensions/ServicesExtension.php b/site/vendor/nette/di/src/DI/Extensions/ServicesExtension.php index 7a92aeedd..8bb50257d 100644 --- a/site/vendor/nette/di/src/DI/Extensions/ServicesExtension.php +++ b/site/vendor/nette/di/src/DI/Extensions/ServicesExtension.php @@ -16,19 +16,17 @@ /** - * Service definitions loader. + * Services definitions loader. */ final class ServicesExtension extends Nette\DI\CompilerExtension { - use Nette\SmartObject; - public function getConfigSchema(): Nette\Schema\Schema { return Nette\Schema\Expect::arrayOf(new DefinitionSchema($this->getContainerBuilder())); } - public function loadConfiguration() + public function loadConfiguration(): void { $this->loadDefinitions($this->config); } @@ -37,7 +35,7 @@ public function loadConfiguration() /** * Loads list of service definitions. */ - public function loadDefinitions(array $config) + public function loadDefinitions(array $config): void { foreach ($config as $key => $defConfig) { $this->loadDefinition($this->convertKeyToName($key), $defConfig); @@ -103,7 +101,7 @@ private function updateServiceDefinition(Definitions\ServiceDefinition $definiti $definition->setSetup([]); } - foreach (Helpers::filterArguments($config->setup) as $id => $setup) { + foreach (Helpers::filterArguments($config->setup) as $setup) { if (is_array($setup)) { $setup = new Statement(key($setup), array_values($setup)); } @@ -136,7 +134,7 @@ private function updateFactoryDefinition(Definitions\FactoryDefinition $definiti if (isset($config->implement)) { $definition->setImplement($config->implement); - $definition->setAutowired(true); + $definition->setAutowired(); } if ($config->create) { @@ -161,7 +159,7 @@ private function updateFactoryDefinition(Definitions\FactoryDefinition $definiti $resultDef->setSetup([]); } - foreach (Helpers::filterArguments($config->setup) as $id => $setup) { + foreach (Helpers::filterArguments($config->setup) as $setup) { if (is_array($setup)) { $setup = new Statement(key($setup), array_values($setup)); } @@ -170,10 +168,6 @@ private function updateFactoryDefinition(Definitions\FactoryDefinition $definiti } } - if (isset($config->parameters)) { - $definition->setParameters($config->parameters); - } - if (isset($config->inject)) { $definition->addTag(InjectExtension::TagInject, $config->inject); } @@ -187,6 +181,16 @@ private function updateLocatorDefinition(Definitions\LocatorDefinition $definiti } if (isset($config->references)) { + foreach ($config->references as $name => $reference) { + if ($reference instanceof Statement) { + $config->references[$name] = '@' . $this->getContainerBuilder() + ->addDefinition(null) + ->setFactory($reference) + ->setAutowired(false) + ->getName(); + } + } + $definition->setReferences($config->references); } @@ -231,7 +235,7 @@ private function convertKeyToName($key): ?string if (is_int($key)) { return null; } elseif (preg_match('#^@[\w\\\\]+$#D', $key)) { - return $this->getContainerBuilder()->getByType(substr($key, 1), true); + return $this->getContainerBuilder()->getByType(substr($key, 1), throw: true); } return $key; diff --git a/site/vendor/nette/di/src/DI/Helpers.php b/site/vendor/nette/di/src/DI/Helpers.php index 7ad902fb9..c662e2afe 100644 --- a/site/vendor/nette/di/src/DI/Helpers.php +++ b/site/vendor/nette/di/src/DI/Helpers.php @@ -26,12 +26,9 @@ final class Helpers /** * Expands %placeholders%. - * @param mixed $var - * @param bool|array $recursive - * @return mixed * @throws Nette\InvalidArgumentException */ - public static function expand($var, array $params, $recursive = false) + public static function expand(mixed $var, array $params, bool|array $recursive = false): mixed { if (is_array($var)) { $res = []; @@ -43,10 +40,11 @@ public static function expand($var, array $params, $recursive = false) } elseif ($var instanceof Statement) { return new Statement( self::expand($var->getEntity(), $params, $recursive), - self::expand($var->arguments, $params, $recursive) + self::expand($var->arguments, $params, $recursive), ); } elseif ($var === '%parameters%' && !array_key_exists('parameters', $params)) { + trigger_error('%parameters% is deprecated, use @container::getParameters()', E_USER_DEPRECATED); return $recursive ? self::expand($params, $params, $recursive) : $params; @@ -65,7 +63,12 @@ public static function expand($var, array $params, $recursive = false) * Expands %placeholders% in string * @throws Nette\InvalidArgumentException */ - private static function expandString(string $string, array $params, ?array $recursive, bool $onlyString = false) + private static function expandString( + string $string, + array $params, + ?array $recursive, + bool $onlyString = false, + ): mixed { $parts = preg_split('#%([\w.-]*)%#i', $string, -1, PREG_SPLIT_DELIM_CAPTURE); $res = []; @@ -88,12 +91,17 @@ private static function expandString(string $string, array $params, ?array $recu } return $dynamic - ? new Statement('::implode', ['', $res]) + ? new Statement('::implode', [$res]) : implode('', $res); } - private static function expandParameter(string $parameter, array $params, ?array $recursive, bool $onlyString) + private static function expandParameter( + string $parameter, + array $params, + ?array $recursive, + bool $onlyString, + ): mixed { $val = $params; $path = []; @@ -113,6 +121,8 @@ private static function expandParameter(string $parameter, array $params, ?array } } elseif ($val instanceof DynamicParameter) { $val = new DynamicParameter($val . '[' . var_export($key, true) . ']'); + } elseif ($val instanceof Statement) { + $val = new Statement('(?)[?]', [$val, $key]); } else { throw new Nette\InvalidArgumentException(sprintf("Missing parameter '%s'.", $parameter)); } @@ -123,10 +133,8 @@ private static function expandParameter(string $parameter, array $params, ?array /** * Escapes '%' and '@' - * @param mixed $value - * @return mixed */ - public static function escape($value) + public static function escape(mixed $value): mixed { if (is_array($value)) { $res = []; @@ -151,14 +159,13 @@ public static function filterArguments(array $args): array { foreach ($args as $k => $v) { if ( - PHP_VERSION_ID >= 80100 - && is_string($v) + is_string($v) && preg_match('#^([\w\\\\]+)::\w+$#D', $v, $m) && enum_exists($m[1]) ) { - $args[$k] = new Nette\PhpGenerator\PhpLiteral($v); + $args[$k] = new Nette\PhpGenerator\Literal($v); } elseif (is_string($v) && preg_match('#^[\w\\\\]*::[A-Z][a-zA-Z0-9_]*$#D', $v)) { - $args[$k] = new Nette\PhpGenerator\PhpLiteral(ltrim($v, ':')); + $args[$k] = new Nette\PhpGenerator\Literal(ltrim($v, ':')); } elseif (is_string($v) && preg_match('#^@[\w\\\\]+$#D', $v)) { $args[$k] = new Reference(substr($v, 1)); } elseif (is_array($v)) { @@ -175,10 +182,8 @@ public static function filterArguments(array $args): array /** * Replaces @extension with real extension name in service definition. - * @param mixed $config - * @return mixed */ - public static function prefixServiceName($config, string $namespace) + public static function prefixServiceName(mixed $config, string $namespace): mixed { if (is_string($config)) { if (strncmp($config, '@extension.', 10) === 0) { @@ -191,7 +196,7 @@ public static function prefixServiceName($config, string $namespace) } elseif ($config instanceof Statement) { return new Statement( self::prefixServiceName($config->getEntity(), $namespace), - self::prefixServiceName($config->arguments, $namespace) + self::prefixServiceName($config->arguments, $namespace), ); } elseif (is_array($config)) { foreach ($config as &$val) { @@ -205,7 +210,6 @@ public static function prefixServiceName($config, string $namespace) /** * Returns an annotation value. - * @param \ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionClass $ref */ public static function parseAnnotation(\Reflector $ref, string $name): ?string { @@ -263,11 +267,9 @@ public static function normalizeClass(string $type): string /** * Non data-loss type conversion. - * @param mixed $value - * @return mixed * @throws Nette\InvalidStateException */ - public static function convertType($value, string $type) + public static function convertType(mixed $value, string $type): mixed { if (is_scalar($value)) { $norm = ($value === false ? '0' : (string) $value); @@ -284,8 +286,8 @@ public static function convertType($value, string $type) throw new Nette\InvalidStateException(sprintf( 'Cannot convert %s to %s.', - is_scalar($value) ? "'$value'" : gettype($value), - $type + is_scalar($value) ? "'$value'" : get_debug_type($value), + $type, )); } } diff --git a/site/vendor/nette/di/src/DI/PhpGenerator.php b/site/vendor/nette/di/src/DI/PhpGenerator.php index 00ba2755d..42a979059 100644 --- a/site/vendor/nette/di/src/DI/PhpGenerator.php +++ b/site/vendor/nette/di/src/DI/PhpGenerator.php @@ -13,7 +13,6 @@ use Nette\DI\Definitions\Reference; use Nette\DI\Definitions\Statement; use Nette\PhpGenerator as Php; -use Nette\Utils\Strings; /** @@ -21,13 +20,8 @@ */ class PhpGenerator { - use Nette\SmartObject; - - /** @var ContainerBuilder */ - private $builder; - - /** @var string */ - private $className; + private ContainerBuilder $builder; + private ?string $className = null; public function __construct(ContainerBuilder $builder) @@ -44,15 +38,11 @@ public function generate(string $className): Php\ClassType $this->className = $className; $class = new Php\ClassType($this->className); $class->setExtends(Container::class); - $class->addMethod('__construct') - ->addBody('parent::__construct($params);') - ->addParameter('params', []) - ->setType('array'); + $class->inheritMethod('__construct') + ->addBody('parent::__construct($params);'); foreach ($this->builder->exportMeta() as $key => $value) { - $class->addProperty($key) - ->setProtected() - ->setValue($value); + $class->inheritProperty($key)->setValue($value); } $definitions = $this->builder->getDefinitions(); @@ -66,8 +56,7 @@ public function generate(string $className): Php\ClassType ->setReturnType($className) ->setBody('return $this;'); - $class->addMethod('initialize') - ->setReturnType('void'); + $class->inheritMethod('initialize'); return $class; } @@ -119,7 +108,7 @@ public function formatStatement(Statement $statement): string $arguments = $statement->arguments; switch (true) { - case is_string($entity) && Strings::contains($entity, '?'): // PHP literal + case is_string($entity) && str_contains($entity, '?'): // PHP literal return $this->formatPhp($entity, $arguments); case is_string($entity): // create class @@ -131,7 +120,7 @@ public function formatStatement(Statement $statement): string switch (true) { case $entity[1][0] === '$': // property getter, setter or appender $name = substr($entity[1], 1); - if ($append = (substr($name, -2) === '[]')) { + if ($append = (str_ends_with($name, '[]'))) { $name = substr($name, 0, -2); } @@ -144,7 +133,7 @@ public function formatStatement(Statement $statement): string case $entity[0] instanceof Statement: $inner = $this->formatPhp('?', [$entity[0]]); - if (substr($inner, 0, 4) === 'new ') { + if (str_starts_with($inner, 'new ')) { $inner = "($inner)"; } @@ -190,35 +179,17 @@ public function convertArguments(array $args): array } else { $val = ContainerBuilder::literal('$this->getService(?)', [$name]); } + } elseif ( + is_object($val) + && !$val instanceof Php\Literal && !$val instanceof \stdClass && !$val instanceof \UnitEnum + ) { + trigger_error(sprintf('Nette DI: suspicious dumping of objects %s when generating the container', $val::class)); } }); return $args; } - /** - * Converts parameters from Definition to PhpGenerator. - * @return Php\Parameter[] - */ - public function convertParameters(array $parameters): array - { - $res = []; - foreach ($parameters as $k => $v) { - $tmp = explode(' ', is_int($k) ? $v : $k); - $param = $res[] = new Php\Parameter(end($tmp)); - if (!is_int($k)) { - $param->setDefaultValue($v); - } - - if (isset($tmp[1])) { - $param->setType($tmp[0]); - } - } - - return $res; - } - - public function getClassName(): ?string { return $this->className; diff --git a/site/vendor/nette/di/src/DI/Resolver.php b/site/vendor/nette/di/src/DI/Resolver.php index 15ec7db1a..5848d73fe 100644 --- a/site/vendor/nette/di/src/DI/Resolver.php +++ b/site/vendor/nette/di/src/DI/Resolver.php @@ -17,9 +17,7 @@ use Nette\Utils\Arrays; use Nette\Utils\Callback; use Nette\Utils\Reflection; -use Nette\Utils\Strings; use Nette\Utils\Validators; -use ReflectionClass; /** @@ -28,22 +26,13 @@ */ class Resolver { - use Nette\SmartObject; + private ContainerBuilder $builder; + private ?Definition $currentService = null; + private ?string $currentServiceType = null; + private bool $currentServiceAllowed = false; - /** @var ContainerBuilder */ - private $builder; - - /** @var Definition|null */ - private $currentService; - - /** @var string|null */ - private $currentServiceType; - - /** @var bool */ - private $currentServiceAllowed = false; - - /** @var \SplObjectStorage circular reference detector */ - private $recursive; + /** circular reference detector */ + private \SplObjectStorage $recursive; public function __construct(ContainerBuilder $builder) @@ -62,7 +51,7 @@ public function getContainerBuilder(): ContainerBuilder public function resolveDefinition(Definition $def): void { if ($this->recursive->contains($def)) { - $names = array_map(function ($item) { return $item->getName(); }, iterator_to_array($this->recursive)); + $names = array_map(fn($item) => $item->getName(), iterator_to_array($this->recursive)); throw new ServiceCreationException(sprintf('Circular reference detected for services: %s.', implode(', ', $names))); } @@ -104,7 +93,10 @@ public function resolveEntityType(Statement $statement): ?string { $entity = $this->normalizeEntity($statement); - if (is_array($entity)) { + if ($statement->arguments === self::getFirstClassCallable()) { + return \Closure::class; + + } elseif (is_array($entity)) { if ($entity[0] instanceof Reference || $entity[0] instanceof Statement) { $entity[0] = $this->resolveEntityType($entity[0] instanceof Statement ? $entity[0] : new Statement($entity[0])); if (!$entity[0]) { @@ -131,12 +123,16 @@ public function resolveEntityType(Statement $statement): ?string $this->addDependency($reflection); $type = Nette\Utils\Type::fromReflection($reflection) ?? ($annotation = Helpers::getReturnTypeAnnotation($reflection)); - if ($type && !in_array($type->getSingleName(), ['object', 'mixed'], true)) { + if ($type && !in_array($type->getSingleName(), ['object', 'mixed'], strict: true)) { if (isset($annotation)) { trigger_error('Annotation @return should be replaced with native return type at ' . Callback::toString($entity), E_USER_DEPRECATED); } - return Helpers::ensureClassType($type, sprintf('return type of %s()', Callback::toString($entity)), true); + return Helpers::ensureClassType( + $type, + sprintf('return type of %s()', Callback::toString($entity)), + allowNullable: true, + ); } return null; @@ -150,7 +146,7 @@ public function resolveEntityType(Statement $statement): ?string interface_exists($entity) ? "Interface %s can not be used as 'create' or 'factory', did you mean 'implement'?" : "Class '%s' not found.", - $entity + $entity, )); } @@ -163,7 +159,7 @@ interface_exists($entity) public function completeDefinition(Definition $def): void { - $this->currentService = in_array($def, $this->builder->getDefinitions(), true) + $this->currentService = in_array($def, $this->builder->getDefinitions(), strict: true) ? $def : null; $this->currentServiceType = $def->getType(); @@ -188,14 +184,21 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo $this->currentServiceAllowed = $currentServiceAllowed; $entity = $this->normalizeEntity($statement); $arguments = $this->convertReferences($statement->arguments); - $getter = function (string $type, bool $single) { - return $single + $getter = fn(string $type, bool $single) => $single ? $this->getByType($type) - : array_values(array_filter($this->builder->findAutowired($type), function ($obj) { return $obj !== $this->currentService; })); - }; + : array_values(array_filter($this->builder->findAutowired($type), fn($obj) => $obj !== $this->currentService)); switch (true) { - case is_string($entity) && Strings::contains($entity, '?'): // PHP literal + case $statement->arguments === self::getFirstClassCallable(): + if (!is_array($entity) || !PhpHelpers::isIdentifier($entity[1])) { + throw new ServiceCreationException(sprintf('Cannot create closure for %s(...)', $entity)); + } + if ($entity[0] instanceof Statement) { + $entity[0] = $this->completeStatement($entity[0], $this->currentServiceAllowed); + } + break; + + case is_string($entity) && str_contains($entity, '?'): // PHP literal break; case $entity === 'not': @@ -221,17 +224,17 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo case is_string($entity): // create class if (!class_exists($entity)) { throw new ServiceCreationException(sprintf("Class '%s' not found.", $entity)); - } elseif ((new ReflectionClass($entity))->isAbstract()) { + } elseif ((new \ReflectionClass($entity))->isAbstract()) { throw new ServiceCreationException(sprintf('Class %s is abstract.', $entity)); - } elseif (($rm = (new ReflectionClass($entity))->getConstructor()) !== null && !$rm->isPublic()) { + } elseif (($rm = (new \ReflectionClass($entity))->getConstructor()) !== null && !$rm->isPublic()) { throw new ServiceCreationException(sprintf('Class %s has %s constructor.', $entity, $rm->isProtected() ? 'protected' : 'private')); - } elseif ($constructor = (new ReflectionClass($entity))->getConstructor()) { + } elseif ($constructor = (new \ReflectionClass($entity))->getConstructor()) { $arguments = self::autowireArguments($constructor, $arguments, $getter); $this->addDependency($constructor); } elseif ($arguments) { throw new ServiceCreationException(sprintf( 'Unable to pass arguments, class %s has no constructor.', - $entity + $entity, )); } @@ -242,10 +245,10 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo break; case is_array($entity): - if (!preg_match('#^\$?(\\\\?' . PhpHelpers::PHP_IDENT . ')+(\[\])?$#D', $entity[1])) { + if (!preg_match('#^\$?(\\\\?' . PhpHelpers::ReIdentifier . ')+(\[\])?$#D', $entity[1])) { throw new ServiceCreationException(sprintf( "Expected function, method or property name, '%s' given.", - $entity[1] + $entity[1], )); } @@ -254,7 +257,7 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo if (!Arrays::isList($arguments)) { throw new ServiceCreationException(sprintf( 'Unable to pass specified arguments to %s.', - $entity[0] + $entity[0], )); } elseif (!function_exists($entity[1])) { throw new ServiceCreationException(sprintf("Function %s doesn't exist.", $entity[1])); @@ -273,7 +276,7 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo case $entity[0] instanceof Reference: if ($entity[1][0] === '$') { // property getter, setter or appender Validators::assert($arguments, 'list:0..1', "setup arguments for '" . Callback::toString($entity) . "'"); - if (!$arguments && substr($entity[1], -2) === '[]') { + if (!$arguments && str_ends_with($entity[1], '[]')) { throw new ServiceCreationException(sprintf('Missing argument for %s.', $entity[1])); } } elseif ( @@ -281,7 +284,7 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo ? $this->resolveReferenceType($entity[0]) : $this->resolveEntityType($entity[0] instanceof Statement ? $entity[0] : new Statement($entity[0])) ) { - $rc = new ReflectionClass($type); + $rc = new \ReflectionClass($type); if ($rc->hasMethod($entity[1])) { $rm = $rc->getMethod($entity[1]); if (!$rm->isPublic()) { @@ -301,7 +304,7 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo try { $arguments = $this->completeArguments($arguments); } catch (ServiceCreationException $e) { - if (!strpos($e->getMessage(), ' (used in')) { + if (!str_contains($e->getMessage(), ' (used in')) { $e->setMessage($e->getMessage() . " (used in {$this->entityToString($entity)})"); } @@ -319,9 +322,7 @@ public function completeArguments(array $arguments): array $entity = $val->getEntity(); if ($entity === 'typed' || $entity === 'tagged') { $services = []; - $current = $this->currentService - ? $this->currentService->getName() - : null; + $current = $this->currentService?->getName(); foreach ($val->arguments as $argument) { foreach ($entity === 'tagged' ? $this->builder->findByTag($argument) : $this->builder->findAutowired($argument) as $name => $foo) { if ($name !== $current) { @@ -342,8 +343,8 @@ public function completeArguments(array $arguments): array } - /** @return string|array|Reference literal, Class, Reference, [Class, member], [, globalFunc], [Reference, member], [Statement, member] */ - private function normalizeEntity(Statement $statement) + /** Returns literal, Class, Reference, [Class, member], [, globalFunc], [Reference, member], [Statement, member] */ + private function normalizeEntity(Statement $statement): string|array|Reference|null { $entity = $statement->getEntity(); if (is_array($entity)) { @@ -353,7 +354,7 @@ private function normalizeEntity(Statement $statement) } if ($item instanceof Definition) { - $name = current(array_keys($this->builder->getDefinitions(), $item, true)); + $name = current(array_keys($this->builder->getDefinitions(), $item, strict: true)); if ($name === false) { throw new ServiceCreationException(sprintf("Service '%s' not found in definitions.", $item->getName())); } @@ -389,7 +390,7 @@ public function normalizeReference(Reference $ref): Reference try { return $this->getByType($service); - } catch (NotAllowedDuringResolvingException $e) { + } catch (NotAllowedDuringResolvingException) { return new Reference($service); } } @@ -413,12 +414,12 @@ public function getByType(string $type): Reference if ( $this->currentService && $this->currentServiceAllowed - && is_a($this->currentServiceType, $type, true) + && is_a($this->currentServiceType, $type, allow_string: true) ) { return new Reference(Reference::Self); } - $name = $this->builder->getByType($type, true); + $name = $this->builder->getByType($type, throw: true); if ( !$this->currentServiceAllowed && $this->currentService === $this->builder->getDefinition($name) @@ -432,10 +433,8 @@ public function getByType(string $type): Reference /** * Adds item to the list of dependencies. - * @param \ReflectionClass|\ReflectionFunctionAbstract|string $dep - * @return static */ - public function addDependency($dep) + public function addDependency(\ReflectionClass|\ReflectionFunctionAbstract|string $dep): static { $this->builder->addDependency($dep); return $this; @@ -444,7 +443,7 @@ public function addDependency($dep) private function completeException(\Throwable $e, Definition $def): ServiceCreationException { - if ($e instanceof ServiceCreationException && Strings::startsWith($e->getMessage(), "Service '")) { + if ($e instanceof ServiceCreationException && str_starts_with($e->getMessage(), "Service '")) { return $e; } @@ -472,17 +471,15 @@ private function completeException(\Throwable $e, Definition $def): ServiceCreat private function entityToString($entity): string { - $referenceToText = function (Reference $ref): string { - return $ref->isSelf() && $this->currentService + $referenceToText = fn(Reference $ref): string => $ref->isSelf() && $this->currentService ? '@' . $this->currentService->getName() : '@' . $ref->getValue(); - }; if (is_string($entity)) { return $entity . '::__construct()'; } elseif ($entity instanceof Reference) { $entity = $referenceToText($entity); } elseif (is_array($entity)) { - if (strpos($entity[1], '$') === false) { + if (!str_contains($entity[1], '$')) { $entity[1] .= '()'; } @@ -506,12 +503,12 @@ private function convertReferences(array $arguments): array $pair = explode('::', substr($val, 1), 2); if (!isset($pair[1])) { // @service $val = new Reference($pair[0]); - } elseif (preg_match('#^[A-Z][a-zA-Z0-9_]*$#D', $pair[1], $m)) { // @service::CONSTANT + } elseif (preg_match('#^[A-Z][a-zA-Z0-9_]*$#D', $pair[1])) { // @service::CONSTANT $val = ContainerBuilder::literal($this->resolveReferenceType(new Reference($pair[0])) . '::' . $pair[1]); } else { // @service::property $val = new Statement([new Reference($pair[0]), '$' . $pair[1]]); } - } elseif (is_string($val) && substr($val, 0, 2) === '@@') { // escaped text @@ + } elseif (is_string($val) && str_starts_with($val, '@@')) { // escaped text @@ $val = substr($val, 1); } }); @@ -527,10 +524,9 @@ private function convertReferences(array $arguments): array public static function autowireArguments( \ReflectionFunctionAbstract $method, array $arguments, - callable $getter + callable $getter, ): array { - $optCount = 0; $useName = false; $num = -1; $res = []; @@ -539,10 +535,10 @@ public static function autowireArguments( $paramName = $param->name; if ($param->isVariadic()) { - if ($useName && Arrays::some($arguments, function ($val, $key) { return is_int($key); })) { + if ($useName && Arrays::some($arguments, fn($val, $key) => is_int($key))) { throw new ServiceCreationException(sprintf( 'Cannot use positional argument after named or omitted argument in %s.', - Reflection::toString($param) + Reflection::toString($param), )); } elseif (array_key_exists($paramName, $arguments)) { @@ -550,7 +546,7 @@ public static function autowireArguments( throw new ServiceCreationException(sprintf( 'Parameter %s must be array, %s given.', Reflection::toString($param), - gettype($arguments[$paramName]) + gettype($arguments[$paramName]), )); } @@ -562,49 +558,23 @@ public static function autowireArguments( $arguments = []; } - $optCount = 0; - break; - } elseif (array_key_exists($key = $paramName, $arguments) || array_key_exists($key = $num, $arguments)) { - $res[$useName ? $paramName : $num] = $arguments[$key]; + $val = $arguments[$key]; + $res[$useName ? $paramName : $num] = is_scalar($val) && $param->getAttributes(\SensitiveParameter::class) + ? ContainerBuilder::literal('/*sensitive{*/?/*}*/', [$val]) + : $val; unset($arguments[$key], $arguments[$num]); // unset $num to enable overwriting in configuration } elseif (($aw = self::autowireArgument($param, $getter)) !== null) { $res[$useName ? $paramName : $num] = $aw; - } elseif (PHP_VERSION_ID >= 80000) { - if ($param->isOptional()) { - $useName = true; - } else { - $res[$num] = null; - trigger_error(sprintf( - 'The parameter %s should have a declared value in the configuration.', - Reflection::toString($param) - ), E_USER_DEPRECATED); - } - } else { - $res[$num] = $param->isDefaultValueAvailable() - ? Reflection::getParameterDefaultValue($param) - : null; - - if (!$param->isOptional()) { - trigger_error(sprintf( - 'The parameter %s should have a declared value in the configuration.', - Reflection::toString($param) - ), E_USER_DEPRECATED); - } - } - - if (PHP_VERSION_ID < 80000) { - $optCount = $param->isOptional() && $res[$num] === ($param->isDefaultValueAvailable() ? Reflection::getParameterDefaultValue($param) : null) - ? $optCount + 1 - : 0; + $useName = true; // is optional } } // extra parameters - while (!$useName && !$optCount && array_key_exists(++$num, $arguments)) { + while (!$useName && array_key_exists(++$num, $arguments)) { $res[$num] = $arguments[$num]; unset($arguments[$num]); } @@ -612,10 +582,8 @@ public static function autowireArguments( if ($arguments) { throw new ServiceCreationException(sprintf( 'Unable to pass specified arguments to %s.', - Reflection::toString($method) + Reflection::toString($method), )); - } elseif ($optCount) { - $res = array_slice($res, 0, -$optCount); } return $res; @@ -626,58 +594,49 @@ public static function autowireArguments( * Resolves missing argument using autowiring. * @param (callable(string $type, bool $single): (object|object[]|null)) $getter * @throws ServiceCreationException - * @return mixed */ - private static function autowireArgument(\ReflectionParameter $parameter, callable $getter) + private static function autowireArgument(\ReflectionParameter $parameter, callable $getter): mixed { $desc = Reflection::toString($parameter); $type = Nette\Utils\Type::fromReflection($parameter); - if ($type && $type->isClass()) { + if ($type?->isClass()) { $class = $type->getSingleName(); try { $res = $getter($class, true); - } catch (MissingServiceException $e) { + } catch (MissingServiceException) { $res = null; } catch (ServiceCreationException $e) { throw new ServiceCreationException("{$e->getMessage()} (required by $desc)", 0, $e); } - if ($res !== null || $parameter->allowsNull()) { + if ($res !== null || $parameter->isOptional()) { return $res; } elseif (class_exists($class) || interface_exists($class)) { throw new ServiceCreationException(sprintf( 'Service of type %s required by %s not found. Did you add it to configuration file?', $class, - $desc + $desc, )); } else { throw new ServiceCreationException(sprintf( "Class '%s' required by %s not found. Check the parameter type and 'use' statements.", $class, - $desc + $desc, )); } } elseif ($itemType = self::isArrayOf($parameter, $type)) { return $getter($itemType, false); - } elseif ( - ($type && $parameter->allowsNull()) - || $parameter->isOptional() - || $parameter->isDefaultValueAvailable() - ) { - // !optional + defaultAvailable, !optional + !defaultAvailable since 8.1.0 = func($a = null, $b) - // optional + !defaultAvailable, optional + defaultAvailable since 8.0.0 = i.e. Exception::__construct, mysqli::mysqli, ... - // optional + !defaultAvailable = variadics - // in other cases the optional and defaultAvailable are identical + } elseif ($parameter->isOptional()) { return null; } else { throw new ServiceCreationException(sprintf( 'Parameter %s has %s, so its value must be specified.', $desc, - $type && !$type->isSingle() ? 'complex type and no default value' : 'no class type or default value' + $type && !$type->isSimple() ? 'complex type and no default value' : 'no class type or default value', )); } } @@ -687,16 +646,23 @@ private static function isArrayOf(\ReflectionParameter $parameter, ?Nette\Utils\ { $method = $parameter->getDeclaringFunction(); return $method instanceof \ReflectionMethod - && $type - && $type->getSingleName() === 'array' + && $type?->getSingleName() === 'array' && preg_match( '#@param[ \t]+(?|([\w\\\\]+)\[\]|list<([\w\\\\]+)>|array)[ \t]+\$' . $parameter->name . '#', (string) $method->getDocComment(), - $m + $m, ) && ($itemType = Reflection::expandClassName($m[1], $method->getDeclaringClass())) && (class_exists($itemType) || interface_exists($itemType)) ? $itemType : null; } + + + /** @internal */ + public static function getFirstClassCallable(): array + { + static $x = [new Nette\PhpGenerator\Literal('...')]; + return $x; + } } diff --git a/site/vendor/nette/di/src/DI/exceptions.php b/site/vendor/nette/di/src/DI/exceptions.php index b441c5ed3..83fcb526d 100644 --- a/site/vendor/nette/di/src/DI/exceptions.php +++ b/site/vendor/nette/di/src/DI/exceptions.php @@ -25,7 +25,7 @@ class MissingServiceException extends Nette\InvalidStateException */ class ServiceCreationException extends Nette\InvalidStateException { - public function setMessage(string $message): self + public function setMessage(string $message): static { $this->message = $message; return $this; diff --git a/site/vendor/phpstan/phpstan/phpstan.phar b/site/vendor/phpstan/phpstan/phpstan.phar index 8a63504e0..d06f90920 100755 Binary files a/site/vendor/phpstan/phpstan/phpstan.phar and b/site/vendor/phpstan/phpstan/phpstan.phar differ diff --git a/site/vendor/phpstan/phpstan/phpstan.phar.asc b/site/vendor/phpstan/phpstan/phpstan.phar.asc index 31cfd82f9..ea93270d1 100644 --- a/site/vendor/phpstan/phpstan/phpstan.phar.asc +++ b/site/vendor/phpstan/phpstan/phpstan.phar.asc @@ -1,16 +1,16 @@ -----BEGIN PGP SIGNATURE----- -iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmWlDBoACgkQUcZzBf/C -5cCrUQ/9F+fvTIiZGqtJd9wql2ILy5wb4dNw+5gJ1C4kTIIxzTC4kHFUE5CGgUfY -ru2tFiO+PRS8rlK1c1yUY6MZ9KtfVzDNm8y5sXBrHgiisy6hkPpXYEp7t+oKznhY -KZTy6GZsYc74iFrpx5s4xJoBjUJ1qRnR5YrDDYQCaxhp6ppq4k5TCnpwRfAcH1y/ -7V5mgNLxtrNGV2KZoqkxEWBHao7JOzWMrbjPqb8QndDUQFje5Jv1OeDbTrTZvJu2 -arWXUZtBMUKJIYkvBzg2BXZaCE2Qk97uTQWqY5aSSKj+BOb/5uiN3RsFydlJ1iUB -b6SHAxIqHcq8u6xXCEj81cpe2RJyeWFiwbFyEUb61wHxKquSjq9tFA+Rkmk167Lx -HRJsSxRi5m0Z7Yf+b9+59hqFDB5gW82yk5KVLB9RDj5BkKMDhHSgG6RHTuP/VjnS -tJSepbRXyo47y7LcOh5l5ZSHytF8IZ30hmo/nGj5A5uLGSuVmyFcBC8OC34+EvHk -8E3MtfVp5I2fIBm3HNQCTdie8UK6iaKMifEJeUbjbAmEsgmfY8UMbHK8EvzOIx3B -StO72W/JZtFwtuxFsjdlh/kelyTGTgVtbfGzHz8057d3toD/49Y1SJuoXd9ZXcEa -5hsDgXPdocRUxYYorXUUhV3aP47Kg30Xe5Bkp2DdC9HDqe5pFOQ= -=I8YO +iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmWw+a0ACgkQUcZzBf/C +5cAToQ/8D3XHtsO5mN1k9HUQKwSQIhWnFVVleRidk9vFRSZhPJjV7HelLNZw5bnp +ojHGINUlqFHuOxlGGbdYSAQAcix6Jb+CE0kCI5mI3+OBfL2NiF9LHTgG6mMPLsSx +Lvk0Q4Wbl14Zc33252pEiWkRIUGQREM2nYmmYF35SJfhABZhF0wxWTQEBLSDKyn4 +qoeVC55RtafIUJ0x/auxvszp6Z6ca7Z1fmjFyIglhwHLt0iSv2nWcxQKNng/AqHr +a80J7qrcI8L1H69ScargAvh1X/CNp3YCMfDHj15NVOO7tZO+aEFtQARpw8JW+CJx +zEfw6+B0Dk5AMt2KPxDgVKXth+3rKRQ5nF0bo3cyEEikrfVMqhHWu6d0crpDtRfW +hQ5k3bSVbk5aY805pzU3PbGMea0eWY35igiWa/Kyu33dPvXxI/zkRF2zkL76d7K5 +JzWidcs9enz7hTqFTG3bKODogtaIlvN/vjw4hNrojhfam941DT6cicepntq6o6fy +H40f1xQ4W4no7dRs+2HDg63BeYyxKeoya+yCWQY0/q/xFdp5xNS6rMNE9XHXKIPY +3rUw7lbQELr/b1/Ob3o8zhrbpu/BKjkxCrU5bNlUspvBk5c2MA+DmYtbhTZBkUa/ +j99L6ysyNAmoCyy1uRkUR86qsYA3NjpVJntgmSZmbf79vjKa45M= +=9AJu -----END PGP SIGNATURE----- diff --git a/site/vendor/symfony/cache/Adapter/AbstractAdapter.php b/site/vendor/symfony/cache/Adapter/AbstractAdapter.php index ed90f4716..7525fe039 100644 --- a/site/vendor/symfony/cache/Adapter/AbstractAdapter.php +++ b/site/vendor/symfony/cache/Adapter/AbstractAdapter.php @@ -86,7 +86,7 @@ static function ($deferred, $namespace, &$expiredIds, $getId, $defaultLifetime) * * Using ApcuAdapter makes system caches compatible with read-only filesystems. */ - public static function createSystemCache(string $namespace, int $defaultLifetime, string $version, string $directory, LoggerInterface $logger = null): AdapterInterface + public static function createSystemCache(string $namespace, int $defaultLifetime, string $version, string $directory, ?LoggerInterface $logger = null): AdapterInterface { $opcache = new PhpFilesAdapter($namespace, $defaultLifetime, $directory, true); if (null !== $logger) { diff --git a/site/vendor/symfony/cache/Adapter/ApcuAdapter.php b/site/vendor/symfony/cache/Adapter/ApcuAdapter.php index ae794e680..427e575ca 100644 --- a/site/vendor/symfony/cache/Adapter/ApcuAdapter.php +++ b/site/vendor/symfony/cache/Adapter/ApcuAdapter.php @@ -25,7 +25,7 @@ class ApcuAdapter extends AbstractAdapter /** * @throws CacheException if APCu is not enabled */ - public function __construct(string $namespace = '', int $defaultLifetime = 0, string $version = null, MarshallerInterface $marshaller = null) + public function __construct(string $namespace = '', int $defaultLifetime = 0, ?string $version = null, ?MarshallerInterface $marshaller = null) { if (!static::isSupported()) { throw new CacheException('APCu is not enabled.'); diff --git a/site/vendor/symfony/cache/Adapter/ArrayAdapter.php b/site/vendor/symfony/cache/Adapter/ArrayAdapter.php index 63e1f887e..ec5056d7e 100644 --- a/site/vendor/symfony/cache/Adapter/ArrayAdapter.php +++ b/site/vendor/symfony/cache/Adapter/ArrayAdapter.php @@ -74,7 +74,7 @@ static function ($key, $value, $isHit, $tags) { ); } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { $item = $this->getItem($key); $metadata = $item->getMetadata(); diff --git a/site/vendor/symfony/cache/Adapter/ChainAdapter.php b/site/vendor/symfony/cache/Adapter/ChainAdapter.php index d1356248a..304f35fbf 100644 --- a/site/vendor/symfony/cache/Adapter/ChainAdapter.php +++ b/site/vendor/symfony/cache/Adapter/ChainAdapter.php @@ -88,7 +88,7 @@ static function ($sourceItem, $item, $defaultLifetime, $sourceMetadata = null) { ); } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { $doSave = true; $callback = static function (CacheItem $item, bool &$save) use ($callback, &$doSave) { @@ -98,7 +98,7 @@ public function get(string $key, callable $callback, float $beta = null, array & return $value; }; - $wrap = function (CacheItem $item = null, bool &$save = true) use ($key, $callback, $beta, &$wrap, &$doSave, &$metadata) { + $wrap = function (?CacheItem $item = null, bool &$save = true) use ($key, $callback, $beta, &$wrap, &$doSave, &$metadata) { static $lastItem; static $i = 0; $adapter = $this->adapters[$i]; diff --git a/site/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php b/site/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php index f8cb92dbf..18136da17 100644 --- a/site/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php +++ b/site/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php @@ -39,7 +39,7 @@ class CouchbaseBucketAdapter extends AbstractAdapter private \CouchbaseBucket $bucket; private MarshallerInterface $marshaller; - public function __construct(\CouchbaseBucket $bucket, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) + public function __construct(\CouchbaseBucket $bucket, string $namespace = '', int $defaultLifetime = 0, ?MarshallerInterface $marshaller = null) { if (!static::isSupported()) { throw new CacheException('Couchbase >= 2.6.0 < 3.0.0 is required.'); diff --git a/site/vendor/symfony/cache/Adapter/CouchbaseCollectionAdapter.php b/site/vendor/symfony/cache/Adapter/CouchbaseCollectionAdapter.php index b5bb603e3..a1cfb0843 100644 --- a/site/vendor/symfony/cache/Adapter/CouchbaseCollectionAdapter.php +++ b/site/vendor/symfony/cache/Adapter/CouchbaseCollectionAdapter.php @@ -32,7 +32,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter private Collection $connection; private MarshallerInterface $marshaller; - public function __construct(Collection $connection, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) + public function __construct(Collection $connection, string $namespace = '', int $defaultLifetime = 0, ?MarshallerInterface $marshaller = null) { if (!static::isSupported()) { throw new CacheException('Couchbase >= 3.0.5 < 4.0.0 is required.'); @@ -183,7 +183,7 @@ protected function doSave(array $values, $lifetime): array|bool } $upsertOptions = new UpsertOptions(); - $upsertOptions->expiry(\DateTimeImmutable::createFromFormat('U', time() + $lifetime)); + $upsertOptions->expiry($lifetime); $ko = []; foreach ($values as $key => $value) { diff --git a/site/vendor/symfony/cache/Adapter/DoctrineDbalAdapter.php b/site/vendor/symfony/cache/Adapter/DoctrineDbalAdapter.php index 4de4727c5..4ca1b8ec7 100644 --- a/site/vendor/symfony/cache/Adapter/DoctrineDbalAdapter.php +++ b/site/vendor/symfony/cache/Adapter/DoctrineDbalAdapter.php @@ -56,7 +56,7 @@ class DoctrineDbalAdapter extends AbstractAdapter implements PruneableInterface * * @throws InvalidArgumentException When namespace contains invalid characters */ - public function __construct(Connection|string $connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], MarshallerInterface $marshaller = null) + public function __construct(Connection|string $connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], ?MarshallerInterface $marshaller = null) { if (isset($namespace[0]) && preg_match('#[^-+.A-Za-z0-9]#', $namespace, $match)) { throw new InvalidArgumentException(sprintf('Namespace contains "%s" but only characters in [-+.A-Za-z0-9] are allowed.', $match[0])); diff --git a/site/vendor/symfony/cache/Adapter/FilesystemAdapter.php b/site/vendor/symfony/cache/Adapter/FilesystemAdapter.php index 7185dd487..13daa568c 100644 --- a/site/vendor/symfony/cache/Adapter/FilesystemAdapter.php +++ b/site/vendor/symfony/cache/Adapter/FilesystemAdapter.php @@ -20,7 +20,7 @@ class FilesystemAdapter extends AbstractAdapter implements PruneableInterface { use FilesystemTrait; - public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, MarshallerInterface $marshaller = null) + public function __construct(string $namespace = '', int $defaultLifetime = 0, ?string $directory = null, ?MarshallerInterface $marshaller = null) { $this->marshaller = $marshaller ?? new DefaultMarshaller(); parent::__construct('', $defaultLifetime); diff --git a/site/vendor/symfony/cache/Adapter/FilesystemTagAwareAdapter.php b/site/vendor/symfony/cache/Adapter/FilesystemTagAwareAdapter.php index e78536794..80edee433 100644 --- a/site/vendor/symfony/cache/Adapter/FilesystemTagAwareAdapter.php +++ b/site/vendor/symfony/cache/Adapter/FilesystemTagAwareAdapter.php @@ -35,7 +35,7 @@ class FilesystemTagAwareAdapter extends AbstractTagAwareAdapter implements Prune */ private const TAG_FOLDER = 'tags'; - public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, MarshallerInterface $marshaller = null) + public function __construct(string $namespace = '', int $defaultLifetime = 0, ?string $directory = null, ?MarshallerInterface $marshaller = null) { $this->marshaller = new TagAwareMarshaller($marshaller); parent::__construct('', $defaultLifetime); diff --git a/site/vendor/symfony/cache/Adapter/MemcachedAdapter.php b/site/vendor/symfony/cache/Adapter/MemcachedAdapter.php index 8e14016d3..b0a41fedd 100644 --- a/site/vendor/symfony/cache/Adapter/MemcachedAdapter.php +++ b/site/vendor/symfony/cache/Adapter/MemcachedAdapter.php @@ -45,7 +45,7 @@ class MemcachedAdapter extends AbstractAdapter * * Using a MemcachedAdapter as a pure items store is fine. */ - public function __construct(\Memcached $client, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) + public function __construct(\Memcached $client, string $namespace = '', int $defaultLifetime = 0, ?MarshallerInterface $marshaller = null) { if (!static::isSupported()) { throw new CacheException('Memcached > 3.1.5 is required.'); @@ -111,6 +111,8 @@ public static function createConnection(#[\SensitiveParameter] array|string $ser $params = preg_replace_callback('#^memcached:(//)?(?:([^@]*+)@)?#', function ($m) use (&$username, &$password) { if (!empty($m[2])) { [$username, $password] = explode(':', $m[2], 2) + [1 => null]; + $username = rawurldecode($username); + $password = null !== $password ? rawurldecode($password) : null; } return 'file:'.($m[1] ?? ''); diff --git a/site/vendor/symfony/cache/Adapter/NullAdapter.php b/site/vendor/symfony/cache/Adapter/NullAdapter.php index 07c7af816..d5d2ef6b4 100644 --- a/site/vendor/symfony/cache/Adapter/NullAdapter.php +++ b/site/vendor/symfony/cache/Adapter/NullAdapter.php @@ -37,7 +37,7 @@ static function ($key) { ); } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { $save = true; diff --git a/site/vendor/symfony/cache/Adapter/PdoAdapter.php b/site/vendor/symfony/cache/Adapter/PdoAdapter.php index 94a80fe52..4fee819da 100644 --- a/site/vendor/symfony/cache/Adapter/PdoAdapter.php +++ b/site/vendor/symfony/cache/Adapter/PdoAdapter.php @@ -54,7 +54,7 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface * @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION * @throws InvalidArgumentException When namespace contains invalid characters */ - public function __construct(#[\SensitiveParameter] \PDO|string $connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], MarshallerInterface $marshaller = null) + public function __construct(#[\SensitiveParameter] \PDO|string $connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], ?MarshallerInterface $marshaller = null) { if (\is_string($connOrDsn) && str_contains($connOrDsn, '://')) { throw new InvalidArgumentException(sprintf('Usage of Doctrine DBAL URL with "%s" is not supported. Use a PDO DSN or "%s" instead.', __CLASS__, DoctrineDbalAdapter::class)); diff --git a/site/vendor/symfony/cache/Adapter/PhpArrayAdapter.php b/site/vendor/symfony/cache/Adapter/PhpArrayAdapter.php index f6decd848..0cda1cce8 100644 --- a/site/vendor/symfony/cache/Adapter/PhpArrayAdapter.php +++ b/site/vendor/symfony/cache/Adapter/PhpArrayAdapter.php @@ -78,7 +78,7 @@ public static function create(string $file, CacheItemPoolInterface $fallbackPool return new static($file, $fallbackPool); } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { if (!isset($this->values)) { $this->initialize(); diff --git a/site/vendor/symfony/cache/Adapter/PhpFilesAdapter.php b/site/vendor/symfony/cache/Adapter/PhpFilesAdapter.php index b610d293b..b298fbeba 100644 --- a/site/vendor/symfony/cache/Adapter/PhpFilesAdapter.php +++ b/site/vendor/symfony/cache/Adapter/PhpFilesAdapter.php @@ -43,7 +43,7 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface * * @throws CacheException if OPcache is not enabled */ - public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, bool $appendOnly = false) + public function __construct(string $namespace = '', int $defaultLifetime = 0, ?string $directory = null, bool $appendOnly = false) { $this->appendOnly = $appendOnly; self::$startTime ??= $_SERVER['REQUEST_TIME'] ?? time(); diff --git a/site/vendor/symfony/cache/Adapter/ProxyAdapter.php b/site/vendor/symfony/cache/Adapter/ProxyAdapter.php index 88fccde4a..c022dd5fa 100644 --- a/site/vendor/symfony/cache/Adapter/ProxyAdapter.php +++ b/site/vendor/symfony/cache/Adapter/ProxyAdapter.php @@ -80,7 +80,7 @@ static function (CacheItemInterface $innerItem, CacheItem $item, $expiry = null) ); } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { if (!$this->pool instanceof CacheInterface) { return $this->doGet($this, $key, $callback, $beta, $metadata); diff --git a/site/vendor/symfony/cache/Adapter/RedisAdapter.php b/site/vendor/symfony/cache/Adapter/RedisAdapter.php index d8e37b1d7..e33f2f65f 100644 --- a/site/vendor/symfony/cache/Adapter/RedisAdapter.php +++ b/site/vendor/symfony/cache/Adapter/RedisAdapter.php @@ -18,7 +18,7 @@ class RedisAdapter extends AbstractAdapter { use RedisTrait; - public function __construct(\Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|\Relay\Relay $redis, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) + public function __construct(\Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|\Relay\Relay $redis, string $namespace = '', int $defaultLifetime = 0, ?MarshallerInterface $marshaller = null) { $this->init($redis, $namespace, $defaultLifetime, $marshaller); } diff --git a/site/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php b/site/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php index a3ef9f109..a44ef986d 100644 --- a/site/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php +++ b/site/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php @@ -60,7 +60,7 @@ class RedisTagAwareAdapter extends AbstractTagAwareAdapter private string $redisEvictionPolicy; private string $namespace; - public function __construct(\Redis|Relay|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) + public function __construct(\Redis|Relay|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis, string $namespace = '', int $defaultLifetime = 0, ?MarshallerInterface $marshaller = null) { if ($redis instanceof \Predis\ClientInterface && $redis->getConnection() instanceof ClusterInterface && !$redis->getConnection() instanceof PredisCluster) { throw new InvalidArgumentException(sprintf('Unsupported Predis cluster connection: only "%s" is, "%s" given.', PredisCluster::class, get_debug_type($redis->getConnection()))); diff --git a/site/vendor/symfony/cache/Adapter/TagAwareAdapter.php b/site/vendor/symfony/cache/Adapter/TagAwareAdapter.php index dae2991bd..6c4a42802 100644 --- a/site/vendor/symfony/cache/Adapter/TagAwareAdapter.php +++ b/site/vendor/symfony/cache/Adapter/TagAwareAdapter.php @@ -51,7 +51,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac private static \Closure $getTagsByKey; private static \Closure $saveTags; - public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, float $knownTagVersionsTtl = 0.15) + public function __construct(AdapterInterface $itemsPool, ?AdapterInterface $tagsPool = null, float $knownTagVersionsTtl = 0.15) { $this->pool = $itemsPool; $this->tags = $tagsPool ?? $itemsPool; diff --git a/site/vendor/symfony/cache/Adapter/TraceableAdapter.php b/site/vendor/symfony/cache/Adapter/TraceableAdapter.php index 784c156b4..b5bce143f 100644 --- a/site/vendor/symfony/cache/Adapter/TraceableAdapter.php +++ b/site/vendor/symfony/cache/Adapter/TraceableAdapter.php @@ -35,7 +35,7 @@ public function __construct(AdapterInterface $pool) $this->pool = $pool; } - public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed + public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed { if (!$this->pool instanceof CacheInterface) { throw new \BadMethodCallException(sprintf('Cannot call "%s::get()": this class doesn\'t implement "%s".', get_debug_type($this->pool), CacheInterface::class)); diff --git a/site/vendor/symfony/cache/DataCollector/CacheDataCollector.php b/site/vendor/symfony/cache/DataCollector/CacheDataCollector.php index 08ab8816c..b9bcdaf13 100644 --- a/site/vendor/symfony/cache/DataCollector/CacheDataCollector.php +++ b/site/vendor/symfony/cache/DataCollector/CacheDataCollector.php @@ -36,7 +36,7 @@ public function addInstance(string $name, TraceableAdapter $instance): void $this->instances[$name] = $instance; } - public function collect(Request $request, Response $response, \Throwable $exception = null): void + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { $empty = ['calls' => [], 'adapters' => [], 'config' => [], 'options' => [], 'statistics' => []]; $this->data = ['instances' => $empty, 'total' => $empty]; diff --git a/site/vendor/symfony/cache/DependencyInjection/CachePoolPass.php b/site/vendor/symfony/cache/DependencyInjection/CachePoolPass.php index e29e9e298..e1ebd6729 100644 --- a/site/vendor/symfony/cache/DependencyInjection/CachePoolPass.php +++ b/site/vendor/symfony/cache/DependencyInjection/CachePoolPass.php @@ -178,11 +178,11 @@ public function process(ContainerBuilder $container): void $container->removeDefinition('cache.early_expiration_handler'); } - $notAliasedCacheClearerId = $aliasedCacheClearerId = 'cache.global_clearer'; - while ($container->hasAlias('cache.global_clearer')) { - $aliasedCacheClearerId = (string) $container->getAlias('cache.global_clearer'); + $notAliasedCacheClearerId = 'cache.global_clearer'; + while ($container->hasAlias($notAliasedCacheClearerId)) { + $notAliasedCacheClearerId = (string) $container->getAlias($notAliasedCacheClearerId); } - if ($container->hasDefinition($aliasedCacheClearerId)) { + if ($container->hasDefinition($notAliasedCacheClearerId)) { $clearers[$notAliasedCacheClearerId] = $allPools; } diff --git a/site/vendor/symfony/cache/LockRegistry.php b/site/vendor/symfony/cache/LockRegistry.php index 4b750cb44..c5c5fde89 100644 --- a/site/vendor/symfony/cache/LockRegistry.php +++ b/site/vendor/symfony/cache/LockRegistry.php @@ -83,7 +83,7 @@ public static function setFiles(array $files): array return $previousFiles; } - public static function compute(callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata = null, LoggerInterface $logger = null): mixed + public static function compute(callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, ?\Closure $setMetadata = null, ?LoggerInterface $logger = null): mixed { if ('\\' === \DIRECTORY_SEPARATOR && null === self::$lockedFiles) { // disable locking on Windows by default diff --git a/site/vendor/symfony/cache/Marshaller/DefaultMarshaller.php b/site/vendor/symfony/cache/Marshaller/DefaultMarshaller.php index 973b137ae..34bbeb893 100644 --- a/site/vendor/symfony/cache/Marshaller/DefaultMarshaller.php +++ b/site/vendor/symfony/cache/Marshaller/DefaultMarshaller.php @@ -23,7 +23,7 @@ class DefaultMarshaller implements MarshallerInterface private bool $useIgbinarySerialize = true; private bool $throwOnSerializationFailure = false; - public function __construct(bool $useIgbinarySerialize = null, bool $throwOnSerializationFailure = false) + public function __construct(?bool $useIgbinarySerialize = null, bool $throwOnSerializationFailure = false) { if (null === $useIgbinarySerialize) { $useIgbinarySerialize = \extension_loaded('igbinary') && version_compare('3.1.6', phpversion('igbinary'), '<='); diff --git a/site/vendor/symfony/cache/Marshaller/SodiumMarshaller.php b/site/vendor/symfony/cache/Marshaller/SodiumMarshaller.php index ee64c949a..49eb716a6 100644 --- a/site/vendor/symfony/cache/Marshaller/SodiumMarshaller.php +++ b/site/vendor/symfony/cache/Marshaller/SodiumMarshaller.php @@ -29,7 +29,7 @@ class SodiumMarshaller implements MarshallerInterface * more rotating keys can be provided to decrypt values; * each key must be generated using sodium_crypto_box_keypair() */ - public function __construct(array $decryptionKeys, MarshallerInterface $marshaller = null) + public function __construct(array $decryptionKeys, ?MarshallerInterface $marshaller = null) { if (!self::isSupported()) { throw new CacheException('The "sodium" PHP extension is not loaded.'); diff --git a/site/vendor/symfony/cache/Marshaller/TagAwareMarshaller.php b/site/vendor/symfony/cache/Marshaller/TagAwareMarshaller.php index f5c2867af..825f32cc0 100644 --- a/site/vendor/symfony/cache/Marshaller/TagAwareMarshaller.php +++ b/site/vendor/symfony/cache/Marshaller/TagAwareMarshaller.php @@ -20,7 +20,7 @@ class TagAwareMarshaller implements MarshallerInterface { private MarshallerInterface $marshaller; - public function __construct(MarshallerInterface $marshaller = null) + public function __construct(?MarshallerInterface $marshaller = null) { $this->marshaller = $marshaller ?? new DefaultMarshaller(); } diff --git a/site/vendor/symfony/cache/Messenger/EarlyExpirationDispatcher.php b/site/vendor/symfony/cache/Messenger/EarlyExpirationDispatcher.php index 0dd43c0d0..af180219e 100644 --- a/site/vendor/symfony/cache/Messenger/EarlyExpirationDispatcher.php +++ b/site/vendor/symfony/cache/Messenger/EarlyExpirationDispatcher.php @@ -27,14 +27,14 @@ class EarlyExpirationDispatcher private ReverseContainer $reverseContainer; private ?\Closure $callbackWrapper; - public function __construct(MessageBusInterface $bus, ReverseContainer $reverseContainer, callable $callbackWrapper = null) + public function __construct(MessageBusInterface $bus, ReverseContainer $reverseContainer, ?callable $callbackWrapper = null) { $this->bus = $bus; $this->reverseContainer = $reverseContainer; $this->callbackWrapper = null === $callbackWrapper ? null : $callbackWrapper(...); } - public function __invoke(callable $callback, CacheItem $item, bool &$save, AdapterInterface $pool, \Closure $setMetadata, LoggerInterface $logger = null): mixed + public function __invoke(callable $callback, CacheItem $item, bool &$save, AdapterInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger = null): mixed { if (!$item->isHit() || null === $message = EarlyExpirationMessage::create($this->reverseContainer, $callback, $item, $pool)) { // The item is stale or the callback cannot be reversed: we must compute the value now diff --git a/site/vendor/symfony/cache/Traits/ContractsTrait.php b/site/vendor/symfony/cache/Traits/ContractsTrait.php index 083ce1f9d..8d830f0ab 100644 --- a/site/vendor/symfony/cache/Traits/ContractsTrait.php +++ b/site/vendor/symfony/cache/Traits/ContractsTrait.php @@ -59,7 +59,7 @@ public function setCallbackWrapper(?callable $callbackWrapper): callable return $previousWrapper; } - private function doGet(AdapterInterface $pool, string $key, callable $callback, ?float $beta, array &$metadata = null): mixed + private function doGet(AdapterInterface $pool, string $key, callable $callback, ?float $beta, ?array &$metadata = null): mixed { if (0 > $beta ??= 1.0) { throw new InvalidArgumentException(sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta)); diff --git a/site/vendor/symfony/cache/Traits/FilesystemCommonTrait.php b/site/vendor/symfony/cache/Traits/FilesystemCommonTrait.php index cd14886ff..7fa0f2e87 100644 --- a/site/vendor/symfony/cache/Traits/FilesystemCommonTrait.php +++ b/site/vendor/symfony/cache/Traits/FilesystemCommonTrait.php @@ -82,7 +82,7 @@ protected function doUnlink(string $file): bool return @unlink($file); } - private function write(string $file, string $data, int $expiresAt = null): bool + private function write(string $file, string $data, ?int $expiresAt = null): bool { $unlink = false; set_error_handler(static fn ($type, $message, $file, $line) => throw new \ErrorException($message, 0, $type, $file, $line)); @@ -119,7 +119,7 @@ private function write(string $file, string $data, int $expiresAt = null): bool } } - private function getFile(string $id, bool $mkdir = false, string $directory = null): string + private function getFile(string $id, bool $mkdir = false, ?string $directory = null): string { // Use xxh128 to favor speed over security, which is not an issue here $hash = str_replace('/', '-', base64_encode(hash('xxh128', static::class.$id, true))); diff --git a/site/vendor/symfony/cache/Traits/RedisTrait.php b/site/vendor/symfony/cache/Traits/RedisTrait.php index 4928db07f..12887c107 100644 --- a/site/vendor/symfony/cache/Traits/RedisTrait.php +++ b/site/vendor/symfony/cache/Traits/RedisTrait.php @@ -563,7 +563,7 @@ protected function doSave(array $values, int $lifetime): array|bool return $failed; } - private function pipeline(\Closure $generator, object $redis = null): \Generator + private function pipeline(\Closure $generator, ?object $redis = null): \Generator { $ids = []; $redis ??= $this->redis; diff --git a/site/vendor/symfony/cache/Traits/RelayProxy.php b/site/vendor/symfony/cache/Traits/RelayProxy.php index c55206ead..90af7a7d4 100644 --- a/site/vendor/symfony/cache/Traits/RelayProxy.php +++ b/site/vendor/symfony/cache/Traits/RelayProxy.php @@ -236,12 +236,12 @@ public function info(...$sections): \Relay\Relay|array|false return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args()); } - public function flushdb($async = false): \Relay\Relay|bool + public function flushdb($sync = null): \Relay\Relay|bool { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushdb(...\func_get_args()); } - public function flushall($async = false): \Relay\Relay|bool + public function flushall($sync = null): \Relay\Relay|bool { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushall(...\func_get_args()); } @@ -326,6 +326,11 @@ public function lastsave(): \Relay\Relay|false|int return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastsave(...\func_get_args()); } + public function lcs($key1, $key2, $options = null): mixed + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lcs(...\func_get_args()); + } + public function bgsave($schedule = false): \Relay\Relay|bool { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgsave(...\func_get_args()); diff --git a/site/vendor/symfony/config/Builder/ClassBuilder.php b/site/vendor/symfony/config/Builder/ClassBuilder.php index 8194a1526..619ebd857 100644 --- a/site/vendor/symfony/config/Builder/ClassBuilder.php +++ b/site/vendor/symfony/config/Builder/ClassBuilder.php @@ -119,7 +119,7 @@ public function addMethod(string $name, string $body, array $params = []): void $this->methods[] = new Method(strtr($body, ['NAME' => $this->camelCase($name)] + $params)); } - public function addProperty(string $name, string $classType = null, string $defaultValue = null): Property + public function addProperty(string $name, ?string $classType = null, ?string $defaultValue = null): Property { $property = new Property($name, '_' !== $name[0] ? $this->camelCase($name) : $name); if (null !== $classType) { diff --git a/site/vendor/symfony/config/CHANGELOG.md b/site/vendor/symfony/config/CHANGELOG.md index 094d5abba..51e2d1fee 100644 --- a/site/vendor/symfony/config/CHANGELOG.md +++ b/site/vendor/symfony/config/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.0 +--- + + * Require explicit argument when calling `NodeBuilder::setParent()` + 6.3 --- diff --git a/site/vendor/symfony/config/ConfigCacheInterface.php b/site/vendor/symfony/config/ConfigCacheInterface.php index be7f0986c..7b9d38897 100644 --- a/site/vendor/symfony/config/ConfigCacheInterface.php +++ b/site/vendor/symfony/config/ConfigCacheInterface.php @@ -39,9 +39,7 @@ public function isFresh(): bool; * @param string $content The content to write into the cache * @param ResourceInterface[]|null $metadata An array of ResourceInterface instances * - * @return void - * * @throws \RuntimeException When the cache file cannot be written */ - public function write(string $content, array $metadata = null); + public function write(string $content, ?array $metadata = null): void; } diff --git a/site/vendor/symfony/config/Definition/ArrayNode.php b/site/vendor/symfony/config/Definition/ArrayNode.php index 1448220cd..15ad47862 100644 --- a/site/vendor/symfony/config/Definition/ArrayNode.php +++ b/site/vendor/symfony/config/Definition/ArrayNode.php @@ -22,20 +22,17 @@ */ class ArrayNode extends BaseNode implements PrototypeNodeInterface { - protected $xmlRemappings = []; - protected $children = []; - protected $allowFalse = false; - protected $allowNewKeys = true; - protected $addIfNotSet = false; - protected $performDeepMerging = true; - protected $ignoreExtraKeys = false; - protected $removeExtraKeys = true; - protected $normalizeKeys = true; - - /** - * @return void - */ - public function setNormalizeKeys(bool $normalizeKeys) + protected array $xmlRemappings = []; + protected array $children = []; + protected bool $allowFalse = false; + protected bool $allowNewKeys = true; + protected bool $addIfNotSet = false; + protected bool $performDeepMerging = true; + protected bool $ignoreExtraKeys = false; + protected bool $removeExtraKeys = true; + protected bool $normalizeKeys = true; + + public function setNormalizeKeys(bool $normalizeKeys): void { $this->normalizeKeys = $normalizeKeys; } @@ -80,10 +77,8 @@ public function getChildren(): array * Sets the xml remappings that should be performed. * * @param array $remappings An array of the form [[string, string]] - * - * @return void */ - public function setXmlRemappings(array $remappings) + public function setXmlRemappings(array $remappings): void { $this->xmlRemappings = $remappings; } @@ -101,40 +96,32 @@ public function getXmlRemappings(): array /** * Sets whether to add default values for this array if it has not been * defined in any of the configuration files. - * - * @return void */ - public function setAddIfNotSet(bool $boolean) + public function setAddIfNotSet(bool $boolean): void { $this->addIfNotSet = $boolean; } /** * Sets whether false is allowed as value indicating that the array should be unset. - * - * @return void */ - public function setAllowFalse(bool $allow) + public function setAllowFalse(bool $allow): void { $this->allowFalse = $allow; } /** * Sets whether new keys can be defined in subsequent configurations. - * - * @return void */ - public function setAllowNewKeys(bool $allow) + public function setAllowNewKeys(bool $allow): void { $this->allowNewKeys = $allow; } /** * Sets if deep merging should occur. - * - * @return void */ - public function setPerformDeepMerging(bool $boolean) + public function setPerformDeepMerging(bool $boolean): void { $this->performDeepMerging = $boolean; } @@ -144,10 +131,8 @@ public function setPerformDeepMerging(bool $boolean) * * @param bool $boolean To allow extra keys * @param bool $remove To remove extra keys - * - * @return void */ - public function setIgnoreExtraKeys(bool $boolean, bool $remove = true) + public function setIgnoreExtraKeys(bool $boolean, bool $remove = true): void { $this->ignoreExtraKeys = $boolean; $this->removeExtraKeys = $this->ignoreExtraKeys && $remove; @@ -161,10 +146,7 @@ public function shouldIgnoreExtraKeys(): bool return $this->ignoreExtraKeys; } - /** - * @return void - */ - public function setName(string $name) + public function setName(string $name): void { $this->name = $name; } @@ -193,12 +175,10 @@ public function getDefaultValue(): mixed /** * Adds a child node. * - * @return void - * * @throws \InvalidArgumentException when the child node has no name * @throws \InvalidArgumentException when the child node's name is not unique */ - public function addChild(NodeInterface $node) + public function addChild(NodeInterface $node): void { $name = $node->getName(); if ('' === $name) { @@ -258,10 +238,7 @@ protected function finalizeValue(mixed $value): mixed return $value; } - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { if (!\is_array($value) && (!$this->allowFalse || false !== $value)) { $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "array", but got "%s"', $this->getPath(), get_debug_type($value))); diff --git a/site/vendor/symfony/config/Definition/BaseNode.php b/site/vendor/symfony/config/Definition/BaseNode.php index 85f0f7eeb..3ef9680bb 100644 --- a/site/vendor/symfony/config/Definition/BaseNode.php +++ b/site/vendor/symfony/config/Definition/BaseNode.php @@ -29,24 +29,24 @@ abstract class BaseNode implements NodeInterface private static array $placeholderUniquePrefixes = []; private static array $placeholders = []; - protected $name; - protected $parent; - protected $normalizationClosures = []; - protected $normalizedTypes = []; - protected $finalValidationClosures = []; - protected $allowOverwrite = true; - protected $required = false; - protected $deprecation = []; - protected $equivalentValues = []; - protected $attributes = []; - protected $pathSeparator; + protected string $name; + protected ?NodeInterface $parent; + protected array $normalizationClosures = []; + protected array $normalizedTypes = []; + protected array $finalValidationClosures = []; + protected bool $allowOverwrite = true; + protected bool $required = false; + protected array $deprecation = []; + protected array $equivalentValues = []; + protected array $attributes = []; + protected string $pathSeparator; private mixed $handlingPlaceholder = null; /** * @throws \InvalidArgumentException if the name contains a period */ - public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) { if (str_contains($name = (string) $name, $pathSeparator)) { throw new \InvalidArgumentException('The name must not contain ".'.$pathSeparator.'".'); @@ -98,10 +98,7 @@ public static function resetPlaceholders(): void self::$placeholders = []; } - /** - * @return void - */ - public function setAttribute(string $key, mixed $value) + public function setAttribute(string $key, mixed $value): void { $this->attributes[$key] = $value; } @@ -121,28 +118,20 @@ public function getAttributes(): array return $this->attributes; } - /** - * @return void - */ - public function setAttributes(array $attributes) + public function setAttributes(array $attributes): void { $this->attributes = $attributes; } - /** - * @return void - */ - public function removeAttribute(string $key) + public function removeAttribute(string $key): void { unset($this->attributes[$key]); } /** * Sets an info message. - * - * @return void */ - public function setInfo(string $info) + public function setInfo(string $info): void { $this->setAttribute('info', $info); } @@ -157,10 +146,8 @@ public function getInfo(): ?string /** * Sets the example configuration for this node. - * - * @return void */ - public function setExample(string|array $example) + public function setExample(string|array $example): void { $this->setAttribute('example', $example); } @@ -175,20 +162,16 @@ public function getExample(): string|array|null /** * Adds an equivalent value. - * - * @return void */ - public function addEquivalentValue(mixed $originalValue, mixed $equivalentValue) + public function addEquivalentValue(mixed $originalValue, mixed $equivalentValue): void { $this->equivalentValues[] = [$originalValue, $equivalentValue]; } /** * Set this node as required. - * - * @return void */ - public function setRequired(bool $boolean) + public function setRequired(bool $boolean): void { $this->required = $boolean; } @@ -202,10 +185,8 @@ public function setRequired(bool $boolean) * @param string $package The name of the composer package that is triggering the deprecation * @param string $version The version of the package that introduced the deprecation * @param string $message the deprecation message to use - * - * @return void */ - public function setDeprecated(string $package, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.') + public function setDeprecated(string $package, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.'): void { $this->deprecation = [ 'package' => $package, @@ -216,10 +197,8 @@ public function setDeprecated(string $package, string $version, string $message /** * Sets if this node can be overridden. - * - * @return void */ - public function setAllowOverwrite(bool $allow) + public function setAllowOverwrite(bool $allow): void { $this->allowOverwrite = $allow; } @@ -228,10 +207,8 @@ public function setAllowOverwrite(bool $allow) * Sets the closures used for normalization. * * @param \Closure[] $closures An array of Closures used for normalization - * - * @return void */ - public function setNormalizationClosures(array $closures) + public function setNormalizationClosures(array $closures): void { $this->normalizationClosures = $closures; } @@ -240,10 +217,8 @@ public function setNormalizationClosures(array $closures) * Sets the list of types supported by normalization. * * see ExprBuilder::TYPE_* constants. - * - * @return void */ - public function setNormalizedTypes(array $types) + public function setNormalizedTypes(array $types): void { $this->normalizedTypes = $types; } @@ -262,10 +237,8 @@ public function getNormalizedTypes(): array * Sets the closures used for final validation. * * @param \Closure[] $closures An array of Closures used for final validation - * - * @return void */ - public function setFinalValidationClosures(array $closures) + public function setFinalValidationClosures(array $closures): void { $this->finalValidationClosures = $closures; } @@ -442,11 +415,9 @@ final public function finalize(mixed $value): mixed /** * Validates the type of a Node. * - * @return void - * * @throws InvalidTypeException when the value is invalid */ - abstract protected function validateType(mixed $value); + abstract protected function validateType(mixed $value): void; /** * Normalizes the value. diff --git a/site/vendor/symfony/config/Definition/BooleanNode.php b/site/vendor/symfony/config/Definition/BooleanNode.php index 7ec903cd6..f6ab5bfb1 100644 --- a/site/vendor/symfony/config/Definition/BooleanNode.php +++ b/site/vendor/symfony/config/Definition/BooleanNode.php @@ -20,10 +20,7 @@ */ class BooleanNode extends ScalarNode { - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { if (!\is_bool($value)) { $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "bool", but got "%s".', $this->getPath(), get_debug_type($value))); diff --git a/site/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php b/site/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php index 3ada5c550..0fae1a169 100644 --- a/site/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php +++ b/site/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php @@ -23,21 +23,21 @@ */ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinitionInterface { - protected $performDeepMerging = true; - protected $ignoreExtraKeys = false; - protected $removeExtraKeys = true; - protected $children = []; - protected $prototype; - protected $atLeastOne = false; - protected $allowNewKeys = true; - protected $key; - protected $removeKeyItem; - protected $addDefaults = false; - protected $addDefaultChildren = false; - protected $nodeBuilder; - protected $normalizeKeys = true; - - public function __construct(?string $name, NodeParentInterface $parent = null) + protected bool $performDeepMerging = true; + protected bool $ignoreExtraKeys = false; + protected bool $removeExtraKeys = true; + protected array $children = []; + protected NodeDefinition $prototype; + protected bool $atLeastOne = false; + protected bool $allowNewKeys = true; + protected ?string $key = null; + protected bool $removeKeyItem = false; + protected bool $addDefaults = false; + protected int|string|array|null|false $addDefaultChildren = false; + protected NodeBuilder $nodeBuilder; + protected bool $normalizeKeys = true; + + public function __construct(?string $name, ?NodeParentInterface $parent = null) { parent::__construct($name, $parent); @@ -45,10 +45,7 @@ public function __construct(?string $name, NodeParentInterface $parent = null) $this->trueEquivalent = []; } - /** - * @return void - */ - public function setBuilder(NodeBuilder $builder) + public function setBuilder(NodeBuilder $builder): void { $this->nodeBuilder = $builder; } @@ -126,7 +123,7 @@ public function addDefaultsIfNotSet(): static * * @return $this */ - public function addDefaultChildrenIfNoneSet(int|string|array $children = null): static + public function addDefaultChildrenIfNoneSet(int|string|array|null $children = null): static { $this->addDefaultChildren = $children; @@ -169,7 +166,7 @@ public function disallowNewKeysInSubsequentConfigs(): static * * @return $this */ - public function fixXmlConfig(string $singular, string $plural = null): static + public function fixXmlConfig(string $singular, ?string $plural = null): static { $this->normalization()->remap($singular, $plural); @@ -425,11 +422,9 @@ protected function createNode(): NodeInterface /** * Validate the configuration of a concrete node. * - * @return void - * * @throws InvalidDefinitionException */ - protected function validateConcreteNode(ArrayNode $node) + protected function validateConcreteNode(ArrayNode $node): void { $path = $node->getPath(); @@ -457,11 +452,9 @@ protected function validateConcreteNode(ArrayNode $node) /** * Validate the configuration of a prototype node. * - * @return void - * * @throws InvalidDefinitionException */ - protected function validatePrototypeNode(PrototypedArrayNode $node) + protected function validatePrototypeNode(PrototypedArrayNode $node): void { $path = $node->getPath(); diff --git a/site/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php b/site/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php index 3d8fad4d5..15e63961a 100644 --- a/site/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php +++ b/site/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php @@ -21,7 +21,7 @@ */ class BooleanNodeDefinition extends ScalarNodeDefinition { - public function __construct(?string $name, NodeParentInterface $parent = null) + public function __construct(?string $name, ?NodeParentInterface $parent = null) { parent::__construct($name, $parent); diff --git a/site/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php b/site/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php index bb40307e1..cf646a140 100644 --- a/site/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php +++ b/site/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php @@ -20,8 +20,6 @@ interface BuilderAwareInterface { /** * Sets a custom children builder. - * - * @return void */ - public function setBuilder(NodeBuilder $builder); + public function setBuilder(NodeBuilder $builder): void; } diff --git a/site/vendor/symfony/config/Definition/Builder/ExprBuilder.php b/site/vendor/symfony/config/Definition/Builder/ExprBuilder.php index 9cb441481..3c33ef080 100644 --- a/site/vendor/symfony/config/Definition/Builder/ExprBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/ExprBuilder.php @@ -26,11 +26,11 @@ class ExprBuilder public const TYPE_NULL = 'null'; public const TYPE_ARRAY = 'array'; - protected $node; + public string $allowedTypes; + public ?\Closure $ifPart = null; + public ?\Closure $thenPart = null; - public $allowedTypes; - public $ifPart; - public $thenPart; + protected NodeDefinition $node; public function __construct(NodeDefinition $node) { @@ -42,7 +42,7 @@ public function __construct(NodeDefinition $node) * * @return $this */ - public function always(\Closure $then = null): static + public function always(?\Closure $then = null): static { $this->ifPart = static fn () => true; $this->allowedTypes = self::TYPE_ANY; @@ -61,7 +61,7 @@ public function always(\Closure $then = null): static * * @return $this */ - public function ifTrue(\Closure $closure = null): static + public function ifTrue(?\Closure $closure = null): static { $this->ifPart = $closure ?? static fn ($v) => true === $v; $this->allowedTypes = self::TYPE_ANY; diff --git a/site/vendor/symfony/config/Definition/Builder/MergeBuilder.php b/site/vendor/symfony/config/Definition/Builder/MergeBuilder.php index f8980a6e0..e22ed446a 100644 --- a/site/vendor/symfony/config/Definition/Builder/MergeBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/MergeBuilder.php @@ -18,9 +18,10 @@ */ class MergeBuilder { - protected $node; - public $allowFalse = false; - public $allowOverwrite = true; + public bool $allowFalse = false; + public bool $allowOverwrite = true; + + protected NodeDefinition $node; public function __construct(NodeDefinition $node) { diff --git a/site/vendor/symfony/config/Definition/Builder/NodeBuilder.php b/site/vendor/symfony/config/Definition/Builder/NodeBuilder.php index 7cda0bc7d..d79075a91 100644 --- a/site/vendor/symfony/config/Definition/Builder/NodeBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/NodeBuilder.php @@ -18,8 +18,8 @@ */ class NodeBuilder implements NodeParentInterface { - protected $parent; - protected $nodeMapping; + protected (NodeDefinition&ParentNodeDefinitionInterface)|null $parent = null; + protected array $nodeMapping; public function __construct() { @@ -39,11 +39,8 @@ public function __construct() * * @return $this */ - public function setParent(ParentNodeDefinitionInterface $parent = null): static + public function setParent((NodeDefinition&ParentNodeDefinitionInterface)|null $parent): static { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->parent = $parent; return $this; @@ -107,10 +104,8 @@ public function variableNode(string $name): VariableNodeDefinition /** * Returns the parent node. - * - * @return NodeDefinition&ParentNodeDefinitionInterface */ - public function end() + public function end(): NodeDefinition&ParentNodeDefinitionInterface { return $this->parent; } diff --git a/site/vendor/symfony/config/Definition/Builder/NodeDefinition.php b/site/vendor/symfony/config/Definition/Builder/NodeDefinition.php index 2c93a0f7d..54e976e24 100644 --- a/site/vendor/symfony/config/Definition/Builder/NodeDefinition.php +++ b/site/vendor/symfony/config/Definition/Builder/NodeDefinition.php @@ -22,23 +22,23 @@ */ abstract class NodeDefinition implements NodeParentInterface { - protected $name; - protected $normalization; - protected $validation; - protected $defaultValue; - protected $default = false; - protected $required = false; - protected $deprecation = []; - protected $merge; - protected $allowEmptyValue = true; - protected $nullEquivalent; - protected $trueEquivalent = true; - protected $falseEquivalent = false; - protected $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR; - protected $parent; - protected $attributes = []; - - public function __construct(?string $name, NodeParentInterface $parent = null) + protected ?string $name = null; + protected NormalizationBuilder $normalization; + protected ValidationBuilder $validation; + protected mixed $defaultValue; + protected bool $default = false; + protected bool $required = false; + protected array $deprecation = []; + protected MergeBuilder $merge; + protected bool $allowEmptyValue = true; + protected mixed $nullEquivalent = null; + protected mixed $trueEquivalent = true; + protected mixed $falseEquivalent = false; + protected string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR; + protected NodeParentInterface|NodeInterface|null $parent; + protected array $attributes = []; + + public function __construct(?string $name, ?NodeParentInterface $parent = null) { $this->parent = $parent; $this->name = $name; @@ -90,8 +90,10 @@ public function attribute(string $key, mixed $value): static /** * Returns the parent node. + * + * @return NodeParentInterface|NodeBuilder|self|ArrayNodeDefinition|VariableNodeDefinition */ - public function end(): NodeParentInterface|NodeBuilder|self|ArrayNodeDefinition|VariableNodeDefinition|null + public function end(): NodeParentInterface { return $this->parent; } diff --git a/site/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php b/site/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php index 0e362d9fa..9ca02e1fa 100644 --- a/site/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php @@ -18,10 +18,11 @@ */ class NormalizationBuilder { - protected $node; - public $before = []; - public $declaredTypes = []; - public $remappings = []; + public array $before = []; + public array $declaredTypes = []; + public array $remappings = []; + + protected NodeDefinition $node; public function __construct(NodeDefinition $node) { @@ -36,7 +37,7 @@ public function __construct(NodeDefinition $node) * * @return $this */ - public function remap(string $key, string $plural = null): static + public function remap(string $key, ?string $plural = null): static { $this->remappings[] = [$key, null === $plural ? $key.'s' : $plural]; @@ -48,7 +49,7 @@ public function remap(string $key, string $plural = null): static * * @return ExprBuilder|$this */ - public function before(\Closure $closure = null): ExprBuilder|static + public function before(?\Closure $closure = null): ExprBuilder|static { if (null !== $closure) { $this->before[] = $closure; diff --git a/site/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php b/site/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php index 890910c95..41129a2ff 100644 --- a/site/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php +++ b/site/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php @@ -20,8 +20,8 @@ */ abstract class NumericNodeDefinition extends ScalarNodeDefinition { - protected $min; - protected $max; + protected int|float|null $min = null; + protected int|float|null $max = null; /** * Ensures that the value is smaller than the given reference. diff --git a/site/vendor/symfony/config/Definition/Builder/TreeBuilder.php b/site/vendor/symfony/config/Definition/Builder/TreeBuilder.php index cdee55772..5170e19d1 100644 --- a/site/vendor/symfony/config/Definition/Builder/TreeBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/TreeBuilder.php @@ -20,17 +20,10 @@ */ class TreeBuilder implements NodeParentInterface { - /** - * @var NodeInterface|null - */ - protected $tree; + protected ?NodeInterface $tree = null; + protected ?NodeDefinition $root = null; - /** - * @var NodeDefinition - */ - protected $root; - - public function __construct(string $name, string $type = 'array', NodeBuilder $builder = null) + public function __construct(string $name, string $type = 'array', ?NodeBuilder $builder = null) { $builder ??= new NodeBuilder(); $this->root = $builder->node($name, $type)->setParent($this); @@ -54,10 +47,7 @@ public function buildTree(): NodeInterface return $this->tree ??= $this->root->getNode(true); } - /** - * @return void - */ - public function setPathSeparator(string $separator) + public function setPathSeparator(string $separator): void { // unset last built as changing path separator changes all nodes $this->tree = null; diff --git a/site/vendor/symfony/config/Definition/Builder/ValidationBuilder.php b/site/vendor/symfony/config/Definition/Builder/ValidationBuilder.php index 1bee851b6..88e089da1 100644 --- a/site/vendor/symfony/config/Definition/Builder/ValidationBuilder.php +++ b/site/vendor/symfony/config/Definition/Builder/ValidationBuilder.php @@ -18,8 +18,9 @@ */ class ValidationBuilder { - protected $node; - public $rules = []; + public array $rules = []; + + protected NodeDefinition $node; public function __construct(NodeDefinition $node) { @@ -31,7 +32,7 @@ public function __construct(NodeDefinition $node) * * @return ExprBuilder|$this */ - public function rule(\Closure $closure = null): ExprBuilder|static + public function rule(?\Closure $closure = null): ExprBuilder|static { if (null !== $closure) { $this->rules[] = $closure; diff --git a/site/vendor/symfony/config/Definition/ConfigurationInterface.php b/site/vendor/symfony/config/Definition/ConfigurationInterface.php index 7b5d443fe..97a325bb6 100644 --- a/site/vendor/symfony/config/Definition/ConfigurationInterface.php +++ b/site/vendor/symfony/config/Definition/ConfigurationInterface.php @@ -22,8 +22,6 @@ interface ConfigurationInterface { /** * Generates the configuration tree builder. - * - * @return TreeBuilder */ - public function getConfigTreeBuilder(); + public function getConfigTreeBuilder(): TreeBuilder; } diff --git a/site/vendor/symfony/config/Definition/Configurator/DefinitionConfigurator.php b/site/vendor/symfony/config/Definition/Configurator/DefinitionConfigurator.php index 006a444be..13fe45ca4 100644 --- a/site/vendor/symfony/config/Definition/Configurator/DefinitionConfigurator.php +++ b/site/vendor/symfony/config/Definition/Configurator/DefinitionConfigurator.php @@ -29,7 +29,7 @@ public function __construct( ) { } - public function import(string $resource, string $type = null, bool $ignoreErrors = false): void + public function import(string $resource, ?string $type = null, bool $ignoreErrors = false): void { $this->loader->setCurrentDir(\dirname($this->path)); $this->loader->import($resource, $type, $ignoreErrors, $this->file); diff --git a/site/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php b/site/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php index 34f93ce07..34584c43b 100644 --- a/site/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php +++ b/site/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php @@ -31,18 +31,12 @@ class XmlReferenceDumper { private ?string $reference = null; - /** - * @return string - */ - public function dump(ConfigurationInterface $configuration, string $namespace = null) + public function dump(ConfigurationInterface $configuration, ?string $namespace = null): string { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace); } - /** - * @return string - */ - public function dumpNode(NodeInterface $node, string $namespace = null) + public function dumpNode(NodeInterface $node, ?string $namespace = null): string { $this->reference = ''; $this->writeNode($node, 0, true, $namespace); @@ -52,7 +46,7 @@ public function dumpNode(NodeInterface $node, string $namespace = null) return $ref; } - private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null): void + private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, ?string $namespace = null): void { $rootName = ($root ? 'config' : $node->getName()); $rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null)); diff --git a/site/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php b/site/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php index 97a391ada..4f720aa97 100644 --- a/site/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php +++ b/site/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php @@ -30,18 +30,12 @@ class YamlReferenceDumper { private ?string $reference = null; - /** - * @return string - */ - public function dump(ConfigurationInterface $configuration) + public function dump(ConfigurationInterface $configuration): string { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree()); } - /** - * @return string - */ - public function dumpAtPath(ConfigurationInterface $configuration, string $path) + public function dumpAtPath(ConfigurationInterface $configuration, string $path): string { $rootNode = $node = $configuration->getConfigTreeBuilder()->buildTree(); @@ -67,10 +61,7 @@ public function dumpAtPath(ConfigurationInterface $configuration, string $path) return $this->dumpNode($node); } - /** - * @return string - */ - public function dumpNode(NodeInterface $node) + public function dumpNode(NodeInterface $node): string { $this->reference = ''; $this->writeNode($node); @@ -80,7 +71,7 @@ public function dumpNode(NodeInterface $node) return $ref; } - private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false): void + private function writeNode(NodeInterface $node, ?NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false): void { $comments = []; $default = ''; diff --git a/site/vendor/symfony/config/Definition/EnumNode.php b/site/vendor/symfony/config/Definition/EnumNode.php index 4edeae904..29fe0bdfb 100644 --- a/site/vendor/symfony/config/Definition/EnumNode.php +++ b/site/vendor/symfony/config/Definition/EnumNode.php @@ -22,7 +22,7 @@ class EnumNode extends ScalarNode { private array $values; - public function __construct(?string $name, NodeInterface $parent = null, array $values = [], string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, array $values = [], string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) { if (!$values) { throw new \InvalidArgumentException('$values must contain at least one element.'); @@ -46,10 +46,7 @@ public function __construct(?string $name, NodeInterface $parent = null, array $ $this->values = $values; } - /** - * @return array - */ - public function getValues() + public function getValues(): array { return $this->values; } @@ -68,10 +65,7 @@ public function getPermissibleValues(string $separator): string }, $this->values))); } - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { if ($value instanceof \UnitEnum) { return; diff --git a/site/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php b/site/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php index 794447bf8..e3f29f8e6 100644 --- a/site/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php +++ b/site/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php @@ -22,10 +22,7 @@ class InvalidConfigurationException extends Exception private ?string $path = null; private bool $containsHints = false; - /** - * @return void - */ - public function setPath(string $path) + public function setPath(string $path): void { $this->path = $path; } @@ -37,10 +34,8 @@ public function getPath(): ?string /** * Adds extra information that is suffixed to the original exception message. - * - * @return void */ - public function addHint(string $hint) + public function addHint(string $hint): void { if (!$this->containsHints) { $this->message .= "\nHint: ".$hint; diff --git a/site/vendor/symfony/config/Definition/FloatNode.php b/site/vendor/symfony/config/Definition/FloatNode.php index ce4193e09..1023a1674 100644 --- a/site/vendor/symfony/config/Definition/FloatNode.php +++ b/site/vendor/symfony/config/Definition/FloatNode.php @@ -20,10 +20,7 @@ */ class FloatNode extends NumericNode { - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { // Integers are also accepted, we just cast them if (\is_int($value)) { diff --git a/site/vendor/symfony/config/Definition/IntegerNode.php b/site/vendor/symfony/config/Definition/IntegerNode.php index 4a3e3253c..3fe70f621 100644 --- a/site/vendor/symfony/config/Definition/IntegerNode.php +++ b/site/vendor/symfony/config/Definition/IntegerNode.php @@ -20,10 +20,7 @@ */ class IntegerNode extends NumericNode { - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { if (!\is_int($value)) { $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "int", but got "%s".', $this->getPath(), get_debug_type($value))); diff --git a/site/vendor/symfony/config/Definition/Loader/DefinitionFileLoader.php b/site/vendor/symfony/config/Definition/Loader/DefinitionFileLoader.php index 506f787ca..940b894f7 100644 --- a/site/vendor/symfony/config/Definition/Loader/DefinitionFileLoader.php +++ b/site/vendor/symfony/config/Definition/Loader/DefinitionFileLoader.php @@ -34,7 +34,7 @@ public function __construct( parent::__construct($locator); } - public function load(mixed $resource, string $type = null): mixed + public function load(mixed $resource, ?string $type = null): mixed { // the loader variable is exposed to the included file below $loader = $this; @@ -57,7 +57,7 @@ public function load(mixed $resource, string $type = null): mixed return null; } - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { if (!\is_string($resource)) { return false; diff --git a/site/vendor/symfony/config/Definition/NumericNode.php b/site/vendor/symfony/config/Definition/NumericNode.php index da32b843a..b55ee922b 100644 --- a/site/vendor/symfony/config/Definition/NumericNode.php +++ b/site/vendor/symfony/config/Definition/NumericNode.php @@ -20,10 +20,10 @@ */ class NumericNode extends ScalarNode { - protected $min; - protected $max; + protected int|float|null $min; + protected int|float|null $max; - public function __construct(?string $name, NodeInterface $parent = null, int|float $min = null, int|float $max = null, string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, int|float|null $min = null, int|float|null $max = null, string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) { parent::__construct($name, $parent, $pathSeparator); $this->min = $min; diff --git a/site/vendor/symfony/config/Definition/Processor.php b/site/vendor/symfony/config/Definition/Processor.php index dc3d4c69b..272ddcc44 100644 --- a/site/vendor/symfony/config/Definition/Processor.php +++ b/site/vendor/symfony/config/Definition/Processor.php @@ -67,7 +67,7 @@ public function processConfiguration(ConfigurationInterface $configuration, arra * @param string $key The key to normalize * @param string|null $plural The plural form of the key if it is irregular */ - public static function normalizeConfig(array $config, string $key, string $plural = null): array + public static function normalizeConfig(array $config, string $key, ?string $plural = null): array { $plural ??= $key.'s'; diff --git a/site/vendor/symfony/config/Definition/PrototypeNodeInterface.php b/site/vendor/symfony/config/Definition/PrototypeNodeInterface.php index 9dce7444b..109889f37 100644 --- a/site/vendor/symfony/config/Definition/PrototypeNodeInterface.php +++ b/site/vendor/symfony/config/Definition/PrototypeNodeInterface.php @@ -20,8 +20,6 @@ interface PrototypeNodeInterface extends NodeInterface { /** * Sets the name of the node. - * - * @return void */ - public function setName(string $name); + public function setName(string $name): void; } diff --git a/site/vendor/symfony/config/Definition/PrototypedArrayNode.php b/site/vendor/symfony/config/Definition/PrototypedArrayNode.php index c105ac1f3..a11e72638 100644 --- a/site/vendor/symfony/config/Definition/PrototypedArrayNode.php +++ b/site/vendor/symfony/config/Definition/PrototypedArrayNode.php @@ -23,12 +23,12 @@ */ class PrototypedArrayNode extends ArrayNode { - protected $prototype; - protected $keyAttribute; - protected $removeKeyAttribute = false; - protected $minNumberOfElements = 0; - protected $defaultValue = []; - protected $defaultChildren; + protected PrototypeNodeInterface $prototype; + protected ?string $keyAttribute = null; + protected bool $removeKeyAttribute = false; + protected int $minNumberOfElements = 0; + protected array $defaultValue = []; + protected ?array $defaultChildren = null; /** * @var NodeInterface[] An array of the prototypes of the simplified value children */ @@ -37,10 +37,8 @@ class PrototypedArrayNode extends ArrayNode /** * Sets the minimum number of elements that a prototype based node must * contain. By default this is zero, meaning no elements. - * - * @return void */ - public function setMinNumberOfElements(int $number) + public function setMinNumberOfElements(int $number): void { $this->minNumberOfElements = $number; } @@ -68,10 +66,8 @@ public function setMinNumberOfElements(int $number) * * @param string $attribute The name of the attribute which value is to be used as a key * @param bool $remove Whether or not to remove the key - * - * @return void */ - public function setKeyAttribute(string $attribute, bool $remove = true) + public function setKeyAttribute(string $attribute, bool $remove = true): void { $this->keyAttribute = $attribute; $this->removeKeyAttribute = $remove; @@ -87,10 +83,8 @@ public function getKeyAttribute(): ?string /** * Sets the default value of this node. - * - * @return void */ - public function setDefaultValue(array $value) + public function setDefaultValue(array $value): void { $this->defaultValue = $value; } @@ -104,10 +98,8 @@ public function hasDefaultValue(): bool * Adds default children when none are set. * * @param int|string|array|null $children The number of children|The child name|The children names to be added - * - * @return void */ - public function setAddChildrenIfNoneSet(int|string|array|null $children = ['defaults']) + public function setAddChildrenIfNoneSet(int|string|array|null $children = ['defaults']): void { if (null === $children) { $this->defaultChildren = ['defaults']; @@ -137,10 +129,8 @@ public function getDefaultValue(): mixed /** * Sets the node prototype. - * - * @return void */ - public function setPrototype(PrototypeNodeInterface $node) + public function setPrototype(PrototypeNodeInterface $node): void { $this->prototype = $node; } @@ -156,11 +146,9 @@ public function getPrototype(): PrototypeNodeInterface /** * Disable adding concrete children for prototyped nodes. * - * @return never - * * @throws Exception */ - public function addChild(NodeInterface $node) + public function addChild(NodeInterface $node): never { throw new Exception('A prototyped array node cannot have concrete children.'); } diff --git a/site/vendor/symfony/config/Definition/ScalarNode.php b/site/vendor/symfony/config/Definition/ScalarNode.php index e11fa1ee1..a7ccb917c 100644 --- a/site/vendor/symfony/config/Definition/ScalarNode.php +++ b/site/vendor/symfony/config/Definition/ScalarNode.php @@ -27,10 +27,7 @@ */ class ScalarNode extends VariableNode { - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { if (!\is_scalar($value) && null !== $value) { $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "scalar", but got "%s".', $this->getPath(), get_debug_type($value))); diff --git a/site/vendor/symfony/config/Definition/VariableNode.php b/site/vendor/symfony/config/Definition/VariableNode.php index 6bdc65b4e..a4fbace8e 100644 --- a/site/vendor/symfony/config/Definition/VariableNode.php +++ b/site/vendor/symfony/config/Definition/VariableNode.php @@ -23,14 +23,11 @@ */ class VariableNode extends BaseNode implements PrototypeNodeInterface { - protected $defaultValueSet = false; - protected $defaultValue; - protected $allowEmptyValue = true; + protected bool $defaultValueSet = false; + protected mixed $defaultValue = null; + protected bool $allowEmptyValue = true; - /** - * @return void - */ - public function setDefaultValue(mixed $value) + public function setDefaultValue(mixed $value): void { $this->defaultValueSet = true; $this->defaultValue = $value; @@ -52,26 +49,18 @@ public function getDefaultValue(): mixed * Sets if this node is allowed to have an empty value. * * @param bool $boolean True if this entity will accept empty values - * - * @return void */ - public function setAllowEmptyValue(bool $boolean) + public function setAllowEmptyValue(bool $boolean): void { $this->allowEmptyValue = $boolean; } - /** - * @return void - */ - public function setName(string $name) + public function setName(string $name): void { $this->name = $name; } - /** - * @return void - */ - protected function validateType(mixed $value) + protected function validateType(mixed $value): void { } diff --git a/site/vendor/symfony/config/Exception/FileLoaderImportCircularReferenceException.php b/site/vendor/symfony/config/Exception/FileLoaderImportCircularReferenceException.php index da0b55ba8..2d2a4de00 100644 --- a/site/vendor/symfony/config/Exception/FileLoaderImportCircularReferenceException.php +++ b/site/vendor/symfony/config/Exception/FileLoaderImportCircularReferenceException.php @@ -18,7 +18,7 @@ */ class FileLoaderImportCircularReferenceException extends LoaderLoadException { - public function __construct(array $resources, int $code = 0, \Throwable $previous = null) + public function __construct(array $resources, int $code = 0, ?\Throwable $previous = null) { $message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]); diff --git a/site/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php b/site/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php index c5173ae58..5641a3145 100644 --- a/site/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php +++ b/site/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php @@ -20,17 +20,14 @@ class FileLocatorFileNotFoundException extends \InvalidArgumentException { private array $paths; - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, array $paths = []) + public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, array $paths = []) { parent::__construct($message, $code, $previous); $this->paths = $paths; } - /** - * @return array - */ - public function getPaths() + public function getPaths(): array { return $this->paths; } diff --git a/site/vendor/symfony/config/Exception/LoaderLoadException.php b/site/vendor/symfony/config/Exception/LoaderLoadException.php index 57afd6a8d..a2d5e33c7 100644 --- a/site/vendor/symfony/config/Exception/LoaderLoadException.php +++ b/site/vendor/symfony/config/Exception/LoaderLoadException.php @@ -25,7 +25,7 @@ class LoaderLoadException extends \Exception * @param \Throwable|null $previous A previous exception * @param string|null $type The type of resource */ - public function __construct(mixed $resource, string $sourceResource = null, int $code = 0, \Throwable $previous = null, string $type = null) + public function __construct(mixed $resource, ?string $sourceResource = null, int $code = 0, ?\Throwable $previous = null, ?string $type = null) { if (!\is_string($resource)) { try { @@ -76,10 +76,7 @@ public function __construct(mixed $resource, string $sourceResource = null, int parent::__construct($message, $code, $previous); } - /** - * @return string - */ - protected function varToString(mixed $var) + protected function varToString(mixed $var): string { if (\is_object($var)) { return sprintf('Object(%s)', $var::class); diff --git a/site/vendor/symfony/config/FileLocator.php b/site/vendor/symfony/config/FileLocator.php index e147d9b1a..bf800694b 100644 --- a/site/vendor/symfony/config/FileLocator.php +++ b/site/vendor/symfony/config/FileLocator.php @@ -20,7 +20,7 @@ */ class FileLocator implements FileLocatorInterface { - protected $paths; + protected array $paths; /** * @param string|string[] $paths A path or an array of paths where to look for resources @@ -31,9 +31,11 @@ public function __construct(string|array $paths = []) } /** - * @return string|array + * @return string|string[] + * + * @psalm-return ($first is true ? string : string[]) */ - public function locate(string $name, string $currentPath = null, bool $first = true) + public function locate(string $name, ?string $currentPath = null, bool $first = true): string|array { if ('' === $name) { throw new \InvalidArgumentException('An empty file name is not valid to be located.'); diff --git a/site/vendor/symfony/config/FileLocatorInterface.php b/site/vendor/symfony/config/FileLocatorInterface.php index e3ca1d49c..87cecf477 100644 --- a/site/vendor/symfony/config/FileLocatorInterface.php +++ b/site/vendor/symfony/config/FileLocatorInterface.php @@ -25,10 +25,12 @@ interface FileLocatorInterface * @param string|null $currentPath The current path * @param bool $first Whether to return the first occurrence or an array of filenames * - * @return string|array The full path to the file or an array of file paths + * @return string|string[] The full path to the file or an array of file paths * * @throws \InvalidArgumentException If $name is empty * @throws FileLocatorFileNotFoundException If a file is not found + * + * @psalm-return ($first is true ? string : string[]) */ - public function locate(string $name, string $currentPath = null, bool $first = true); + public function locate(string $name, ?string $currentPath = null, bool $first = true): string|array; } diff --git a/site/vendor/symfony/config/Loader/DelegatingLoader.php b/site/vendor/symfony/config/Loader/DelegatingLoader.php index fac3724e9..045a559e2 100644 --- a/site/vendor/symfony/config/Loader/DelegatingLoader.php +++ b/site/vendor/symfony/config/Loader/DelegatingLoader.php @@ -28,7 +28,7 @@ public function __construct(LoaderResolverInterface $resolver) $this->resolver = $resolver; } - public function load(mixed $resource, string $type = null): mixed + public function load(mixed $resource, ?string $type = null): mixed { if (false === $loader = $this->resolver->resolve($resource, $type)) { throw new LoaderLoadException($resource, null, 0, null, $type); @@ -37,7 +37,7 @@ public function load(mixed $resource, string $type = null): mixed return $loader->load($resource, $type); } - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { return false !== $this->resolver->resolve($resource, $type); } diff --git a/site/vendor/symfony/config/Loader/FileLoader.php b/site/vendor/symfony/config/Loader/FileLoader.php index 8cfaa23ba..c217cd85b 100644 --- a/site/vendor/symfony/config/Loader/FileLoader.php +++ b/site/vendor/symfony/config/Loader/FileLoader.php @@ -25,13 +25,13 @@ */ abstract class FileLoader extends Loader { - protected static $loading = []; + protected static array $loading = []; - protected $locator; + protected FileLocatorInterface $locator; private ?string $currentDir = null; - public function __construct(FileLocatorInterface $locator, string $env = null) + public function __construct(FileLocatorInterface $locator, ?string $env = null) { $this->locator = $locator; parent::__construct($env); @@ -39,10 +39,8 @@ public function __construct(FileLocatorInterface $locator, string $env = null) /** * Sets the current directory. - * - * @return void */ - public function setCurrentDir(string $dir) + public function setCurrentDir(string $dir): void { $this->currentDir = $dir; } @@ -64,13 +62,11 @@ public function getLocator(): FileLocatorInterface * @param string|null $sourceResource The original resource importing the new resource * @param string|string[]|null $exclude Glob patterns to exclude from the import * - * @return mixed - * * @throws LoaderLoadException * @throws FileLoaderImportCircularReferenceException * @throws FileLocatorFileNotFoundException */ - public function import(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null, string|array $exclude = null) + public function import(mixed $resource, ?string $type = null, bool $ignoreErrors = false, ?string $sourceResource = null, string|array|null $exclude = null): mixed { if (\is_string($resource) && \strlen($resource) !== ($i = strcspn($resource, '*?{[')) && !str_contains($resource, "\n")) { $excluded = []; @@ -101,7 +97,7 @@ public function import(mixed $resource, string $type = null, bool $ignoreErrors /** * @internal */ - protected function glob(string $pattern, bool $recursive, array|GlobResource &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []): iterable + protected function glob(string $pattern, bool $recursive, array|GlobResource|null &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []): iterable { if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) { $prefix = $pattern; @@ -133,7 +129,7 @@ protected function glob(string $pattern, bool $recursive, array|GlobResource &$r yield from $resource; } - private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null): mixed + private function doImport(mixed $resource, ?string $type = null, bool $ignoreErrors = false, ?string $sourceResource = null): mixed { try { $loader = $this->resolve($resource, $type); diff --git a/site/vendor/symfony/config/Loader/GlobFileLoader.php b/site/vendor/symfony/config/Loader/GlobFileLoader.php index f921ec555..31eebf69d 100644 --- a/site/vendor/symfony/config/Loader/GlobFileLoader.php +++ b/site/vendor/symfony/config/Loader/GlobFileLoader.php @@ -18,12 +18,12 @@ */ class GlobFileLoader extends FileLoader { - public function load(mixed $resource, string $type = null): mixed + public function load(mixed $resource, ?string $type = null): mixed { return $this->import($resource); } - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { return 'glob' === $type; } diff --git a/site/vendor/symfony/config/Loader/Loader.php b/site/vendor/symfony/config/Loader/Loader.php index 36e85ad34..ad1c80932 100644 --- a/site/vendor/symfony/config/Loader/Loader.php +++ b/site/vendor/symfony/config/Loader/Loader.php @@ -20,10 +20,10 @@ */ abstract class Loader implements LoaderInterface { - protected $resolver; - protected $env; + protected LoaderResolverInterface $resolver; + protected ?string $env; - public function __construct(string $env = null) + public function __construct(?string $env = null) { $this->env = $env; } @@ -33,20 +33,15 @@ public function getResolver(): LoaderResolverInterface return $this->resolver; } - /** - * @return void - */ - public function setResolver(LoaderResolverInterface $resolver) + public function setResolver(LoaderResolverInterface $resolver): void { $this->resolver = $resolver; } /** * Imports a resource. - * - * @return mixed */ - public function import(mixed $resource, string $type = null) + public function import(mixed $resource, ?string $type = null): mixed { return $this->resolve($resource, $type)->load($resource, $type); } @@ -56,7 +51,7 @@ public function import(mixed $resource, string $type = null) * * @throws LoaderLoadException If no loader is found */ - public function resolve(mixed $resource, string $type = null): LoaderInterface + public function resolve(mixed $resource, ?string $type = null): LoaderInterface { if ($this->supports($resource, $type)) { return $this; diff --git a/site/vendor/symfony/config/Loader/LoaderInterface.php b/site/vendor/symfony/config/Loader/LoaderInterface.php index 4e0746d4d..6ed1893a5 100644 --- a/site/vendor/symfony/config/Loader/LoaderInterface.php +++ b/site/vendor/symfony/config/Loader/LoaderInterface.php @@ -21,32 +21,24 @@ interface LoaderInterface /** * Loads a resource. * - * @return mixed - * * @throws \Exception If something went wrong */ - public function load(mixed $resource, string $type = null); + public function load(mixed $resource, ?string $type = null): mixed; /** * Returns whether this class supports the given resource. * * @param mixed $resource A resource - * - * @return bool */ - public function supports(mixed $resource, string $type = null); + public function supports(mixed $resource, ?string $type = null): bool; /** * Gets the loader resolver. - * - * @return LoaderResolverInterface */ - public function getResolver(); + public function getResolver(): LoaderResolverInterface; /** * Sets the loader resolver. - * - * @return void */ - public function setResolver(LoaderResolverInterface $resolver); + public function setResolver(LoaderResolverInterface $resolver): void; } diff --git a/site/vendor/symfony/config/Loader/LoaderResolver.php b/site/vendor/symfony/config/Loader/LoaderResolver.php index 670e32012..8308d7e89 100644 --- a/site/vendor/symfony/config/Loader/LoaderResolver.php +++ b/site/vendor/symfony/config/Loader/LoaderResolver.php @@ -36,7 +36,7 @@ public function __construct(array $loaders = []) } } - public function resolve(mixed $resource, string $type = null): LoaderInterface|false + public function resolve(mixed $resource, ?string $type = null): LoaderInterface|false { foreach ($this->loaders as $loader) { if ($loader->supports($resource, $type)) { @@ -47,10 +47,7 @@ public function resolve(mixed $resource, string $type = null): LoaderInterface|f return false; } - /** - * @return void - */ - public function addLoader(LoaderInterface $loader) + public function addLoader(LoaderInterface $loader): void { $this->loaders[] = $loader; $loader->setResolver($this); diff --git a/site/vendor/symfony/config/Loader/LoaderResolverInterface.php b/site/vendor/symfony/config/Loader/LoaderResolverInterface.php index 076c5207c..a8bb3a437 100644 --- a/site/vendor/symfony/config/Loader/LoaderResolverInterface.php +++ b/site/vendor/symfony/config/Loader/LoaderResolverInterface.php @@ -23,5 +23,5 @@ interface LoaderResolverInterface * * @param string|null $type The resource type or null if unknown */ - public function resolve(mixed $resource, string $type = null): LoaderInterface|false; + public function resolve(mixed $resource, ?string $type = null): LoaderInterface|false; } diff --git a/site/vendor/symfony/config/Resource/ClassExistenceResource.php b/site/vendor/symfony/config/Resource/ClassExistenceResource.php index cae3877ad..eab04b8d0 100644 --- a/site/vendor/symfony/config/Resource/ClassExistenceResource.php +++ b/site/vendor/symfony/config/Resource/ClassExistenceResource.php @@ -34,7 +34,7 @@ class ClassExistenceResource implements SelfCheckingResourceInterface * @param string $resource The fully-qualified class name * @param bool|null $exists Boolean when the existence check has already been done */ - public function __construct(string $resource, bool $exists = null) + public function __construct(string $resource, ?bool $exists = null) { $this->resource = $resource; if (null !== $exists) { @@ -139,7 +139,7 @@ public function __wakeup(): void * * @internal */ - public static function throwOnRequiredClass(string $class, \Exception $previous = null): void + public static function throwOnRequiredClass(string $class, ?\Exception $previous = null): void { // If the passed class is the resource being checked, we shouldn't throw. if (null === $previous && self::$autoloadedClass === $class) { diff --git a/site/vendor/symfony/config/Resource/DirectoryResource.php b/site/vendor/symfony/config/Resource/DirectoryResource.php index 7560cd3b3..df486a085 100644 --- a/site/vendor/symfony/config/Resource/DirectoryResource.php +++ b/site/vendor/symfony/config/Resource/DirectoryResource.php @@ -29,7 +29,7 @@ class DirectoryResource implements SelfCheckingResourceInterface * * @throws \InvalidArgumentException */ - public function __construct(string $resource, string $pattern = null) + public function __construct(string $resource, ?string $pattern = null) { $resolvedResource = realpath($resource) ?: (file_exists($resource) ? $resource : false); $this->pattern = $pattern; diff --git a/site/vendor/symfony/config/Resource/ReflectionClassResource.php b/site/vendor/symfony/config/Resource/ReflectionClassResource.php index dbd47e66d..dbc927b59 100644 --- a/site/vendor/symfony/config/Resource/ReflectionClassResource.php +++ b/site/vendor/symfony/config/Resource/ReflectionClassResource.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Config\Resource; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Messenger\Handler\MessageSubscriberInterface; use Symfony\Contracts\Service\ServiceSubscriberInterface; /** @@ -191,13 +190,6 @@ private function generateSignature(\ReflectionClass $class): iterable yield print_r($class->name::getSubscribedEvents(), true); } - if (interface_exists(MessageSubscriberInterface::class, false) && $class->isSubclassOf(MessageSubscriberInterface::class)) { - yield MessageSubscriberInterface::class; - foreach ($class->name::getHandledMessages() as $key => $value) { - yield $key.print_r($value, true); - } - } - if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) { yield ServiceSubscriberInterface::class; yield print_r($class->name::getSubscribedServices(), true); diff --git a/site/vendor/symfony/config/ResourceCheckerConfigCache.php b/site/vendor/symfony/config/ResourceCheckerConfigCache.php index a8478a8cc..0070c4f74 100644 --- a/site/vendor/symfony/config/ResourceCheckerConfigCache.php +++ b/site/vendor/symfony/config/ResourceCheckerConfigCache.php @@ -105,11 +105,9 @@ public function isFresh(): bool * @param string $content The content to write in the cache * @param ResourceInterface[] $metadata An array of metadata * - * @return void - * * @throws \RuntimeException When cache file can't be written */ - public function write(string $content, array $metadata = null) + public function write(string $content, ?array $metadata = null): void { $mode = 0666; $umask = umask(); diff --git a/site/vendor/symfony/config/ResourceCheckerInterface.php b/site/vendor/symfony/config/ResourceCheckerInterface.php index 6b1c6c5fb..13ae03f45 100644 --- a/site/vendor/symfony/config/ResourceCheckerInterface.php +++ b/site/vendor/symfony/config/ResourceCheckerInterface.php @@ -29,17 +29,13 @@ interface ResourceCheckerInterface /** * Queries the ResourceChecker whether it can validate a given * resource or not. - * - * @return bool */ - public function supports(ResourceInterface $metadata); + public function supports(ResourceInterface $metadata): bool; /** * Validates the resource. * * @param int $timestamp The timestamp at which the cache associated with this resource was created - * - * @return bool */ - public function isFresh(ResourceInterface $resource, int $timestamp); + public function isFresh(ResourceInterface $resource, int $timestamp): bool; } diff --git a/site/vendor/symfony/config/Util/XmlUtils.php b/site/vendor/symfony/config/Util/XmlUtils.php index cc024da46..d86a5823a 100644 --- a/site/vendor/symfony/config/Util/XmlUtils.php +++ b/site/vendor/symfony/config/Util/XmlUtils.php @@ -42,7 +42,7 @@ private function __construct() * @throws InvalidXmlException When parsing of XML with schema or callable produces any errors unrelated to the XML parsing itself * @throws \RuntimeException When DOM extension is missing */ - public static function parse(string $content, string|callable $schemaOrCallable = null): \DOMDocument + public static function parse(string $content, string|callable|null $schemaOrCallable = null): \DOMDocument { if (!\extension_loaded('dom')) { throw new \LogicException('Extension DOM is required.'); @@ -112,7 +112,7 @@ public static function parse(string $content, string|callable $schemaOrCallable * @throws XmlParsingException When XML parsing returns any errors * @throws \RuntimeException When DOM extension is missing */ - public static function loadFile(string $file, string|callable $schemaOrCallable = null): \DOMDocument + public static function loadFile(string $file, string|callable|null $schemaOrCallable = null): \DOMDocument { if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('Resource "%s" is not a file.', $file)); @@ -238,10 +238,7 @@ public static function phpize(string|\Stringable $value): mixed } } - /** - * @return array - */ - protected static function getXmlErrors(bool $internalErrors) + protected static function getXmlErrors(bool $internalErrors): array { $errors = []; foreach (libxml_get_errors() as $error) { diff --git a/site/vendor/symfony/config/composer.json b/site/vendor/symfony/config/composer.json index dbd34f13b..47adca28d 100644 --- a/site/vendor/symfony/config/composer.json +++ b/site/vendor/symfony/config/composer.json @@ -16,20 +16,20 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "autoload": { diff --git a/site/vendor/symfony/filesystem/Exception/FileNotFoundException.php b/site/vendor/symfony/filesystem/Exception/FileNotFoundException.php index 48b640809..06b732b16 100644 --- a/site/vendor/symfony/filesystem/Exception/FileNotFoundException.php +++ b/site/vendor/symfony/filesystem/Exception/FileNotFoundException.php @@ -19,7 +19,7 @@ */ class FileNotFoundException extends IOException { - public function __construct(string $message = null, int $code = 0, \Throwable $previous = null, string $path = null) + public function __construct(?string $message = null, int $code = 0, ?\Throwable $previous = null, ?string $path = null) { if (null === $message) { if (null === $path) { diff --git a/site/vendor/symfony/filesystem/Exception/IOException.php b/site/vendor/symfony/filesystem/Exception/IOException.php index a3c544553..df3a0850a 100644 --- a/site/vendor/symfony/filesystem/Exception/IOException.php +++ b/site/vendor/symfony/filesystem/Exception/IOException.php @@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface { private ?string $path; - public function __construct(string $message, int $code = 0, \Throwable $previous = null, string $path = null) + public function __construct(string $message, int $code = 0, ?\Throwable $previous = null, ?string $path = null) { $this->path = $path; diff --git a/site/vendor/symfony/filesystem/Filesystem.php b/site/vendor/symfony/filesystem/Filesystem.php index e8ba4958d..b7fc70118 100644 --- a/site/vendor/symfony/filesystem/Filesystem.php +++ b/site/vendor/symfony/filesystem/Filesystem.php @@ -125,7 +125,7 @@ public function exists(string|iterable $files): bool * * @throws IOException When touch fails */ - public function touch(string|iterable $files, int $time = null, int $atime = null): void + public function touch(string|iterable $files, ?int $time = null, ?int $atime = null): void { foreach ($this->toIterable($files) as $file) { if (!($time ? self::box('touch', $file, $time, $atime) : self::box('touch', $file))) { @@ -508,7 +508,7 @@ public function makePathRelative(string $endPath, string $startPath): string * * @throws IOException When file type is unknown */ - public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = []): void + public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []): void { $targetDir = rtrim($targetDir, '/\\'); $originDir = rtrim($originDir, '/\\'); diff --git a/site/vendor/symfony/filesystem/Path.php b/site/vendor/symfony/filesystem/Path.php index 664396235..01b561724 100644 --- a/site/vendor/symfony/filesystem/Path.php +++ b/site/vendor/symfony/filesystem/Path.php @@ -254,7 +254,7 @@ public static function getRoot(string $path): string * @param string|null $extension if specified, only that extension is cut * off (may contain leading dot) */ - public static function getFilenameWithoutExtension(string $path, string $extension = null): string + public static function getFilenameWithoutExtension(string $path, ?string $extension = null): string { if ('' === $path) { return ''; diff --git a/site/vendor/symfony/translation/CHANGELOG.md b/site/vendor/symfony/translation/CHANGELOG.md index 5f9098c07..c06a18366 100644 --- a/site/vendor/symfony/translation/CHANGELOG.md +++ b/site/vendor/symfony/translation/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +7.0 +--- + + * Remove `PhpStringTokenParser` + * Remove `PhpExtractor` in favor of `PhpAstExtractor` + 6.4 --- diff --git a/site/vendor/symfony/translation/Catalogue/AbstractOperation.php b/site/vendor/symfony/translation/Catalogue/AbstractOperation.php index 7dff58ff4..559d3a5d2 100644 --- a/site/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ b/site/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -30,9 +30,9 @@ abstract class AbstractOperation implements OperationInterface public const NEW_BATCH = 'new'; public const ALL_BATCH = 'all'; - protected $source; - protected $target; - protected $result; + protected MessageCatalogueInterface $source; + protected MessageCatalogueInterface $target; + protected MessageCatalogue $result; /** * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. @@ -55,7 +55,7 @@ abstract class AbstractOperation implements OperationInterface * * @var array The array that stores 'all', 'new' and 'obsolete' messages */ - protected $messages; + protected array $messages; private array $domains; @@ -180,8 +180,6 @@ public function moveMessagesToIntlDomainsIfPossible(string $batch = self::ALL_BA * stores the results. * * @param string $domain The domain which the operation will be performed for - * - * @return void */ - abstract protected function processDomain(string $domain); + abstract protected function processDomain(string $domain): void; } diff --git a/site/vendor/symfony/translation/Catalogue/MergeOperation.php b/site/vendor/symfony/translation/Catalogue/MergeOperation.php index 1b777a843..e242dbee1 100644 --- a/site/vendor/symfony/translation/Catalogue/MergeOperation.php +++ b/site/vendor/symfony/translation/Catalogue/MergeOperation.php @@ -24,10 +24,7 @@ */ class MergeOperation extends AbstractOperation { - /** - * @return void - */ - protected function processDomain(string $domain) + protected function processDomain(string $domain): void { $this->messages[$domain] = [ 'all' => [], diff --git a/site/vendor/symfony/translation/Catalogue/TargetOperation.php b/site/vendor/symfony/translation/Catalogue/TargetOperation.php index 2c0ec722e..e3e0878bf 100644 --- a/site/vendor/symfony/translation/Catalogue/TargetOperation.php +++ b/site/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -25,10 +25,7 @@ */ class TargetOperation extends AbstractOperation { - /** - * @return void - */ - protected function processDomain(string $domain) + protected function processDomain(string $domain): void { $this->messages[$domain] = [ 'all' => [], diff --git a/site/vendor/symfony/translation/CatalogueMetadataAwareInterface.php b/site/vendor/symfony/translation/CatalogueMetadataAwareInterface.php index c845959f1..19965eae9 100644 --- a/site/vendor/symfony/translation/CatalogueMetadataAwareInterface.php +++ b/site/vendor/symfony/translation/CatalogueMetadataAwareInterface.php @@ -31,18 +31,14 @@ public function getCatalogueMetadata(string $key = '', string $domain = 'message /** * Adds catalogue metadata to a message domain. - * - * @return void */ - public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'); + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'): void; /** * Deletes catalogue metadata for the given key and domain. * * Passing an empty domain will delete all catalogue metadata. Passing an empty key will * delete all metadata for the given domain. - * - * @return void */ - public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'); + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'): void; } diff --git a/site/vendor/symfony/translation/Command/XliffLintCommand.php b/site/vendor/symfony/translation/Command/XliffLintCommand.php index ba68635db..439562556 100644 --- a/site/vendor/symfony/translation/Command/XliffLintCommand.php +++ b/site/vendor/symfony/translation/Command/XliffLintCommand.php @@ -41,7 +41,7 @@ class XliffLintCommand extends Command private ?\Closure $isReadableProvider; private bool $requireStrictFileNames; - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) + public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null, bool $requireStrictFileNames = true) { parent::__construct($name); @@ -50,10 +50,7 @@ public function __construct(string $name = null, callable $directoryIteratorProv $this->requireStrictFileNames = $requireStrictFileNames; } - /** - * @return void - */ - protected function configure() + protected function configure(): void { $this ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') @@ -109,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return $this->display($io, $filesInfo); } - private function validate(string $content, string $file = null): array + private function validate(string $content, ?string $file = null): array { $errors = []; diff --git a/site/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/site/vendor/symfony/translation/DataCollector/TranslationDataCollector.php index 439ebe11a..d4f49cc66 100644 --- a/site/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ b/site/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -42,7 +42,7 @@ public function lateCollect(): void $this->data = $this->cloneVar($this->data); } - public function collect(Request $request, Response $response, \Throwable $exception = null): void + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { $this->data['locale'] = $this->translator->getLocale(); $this->data['fallback_locales'] = $this->translator->getFallbackLocales(); diff --git a/site/vendor/symfony/translation/DataCollectorTranslator.php b/site/vendor/symfony/translation/DataCollectorTranslator.php index 220b13430..37fa28c0a 100644 --- a/site/vendor/symfony/translation/DataCollectorTranslator.php +++ b/site/vendor/symfony/translation/DataCollectorTranslator.php @@ -40,7 +40,7 @@ public function __construct(TranslatorInterface $translator) $this->translator = $translator; } - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->collectMessage($locale, $domain, $id, $trans, $parameters); @@ -48,10 +48,7 @@ public function trans(?string $id, array $parameters = [], string $domain = null return $trans; } - /** - * @return void - */ - public function setLocale(string $locale) + public function setLocale(string $locale): void { $this->translator->setLocale($locale); } @@ -61,7 +58,7 @@ public function getLocale(): string return $this->translator->getLocale(); } - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -71,7 +68,7 @@ public function getCatalogues(): array return $this->translator->getCatalogues(); } - public function warmUp(string $cacheDir, string $buildDir = null): array + public function warmUp(string $cacheDir, ?string $buildDir = null): array { if ($this->translator instanceof WarmableInterface) { return (array) $this->translator->warmUp($cacheDir, $buildDir); @@ -92,10 +89,7 @@ public function getFallbackLocales(): array return []; } - /** - * @return mixed - */ - public function __call(string $method, array $args) + public function __call(string $method, array $args): mixed { return $this->translator->{$method}(...$args); } diff --git a/site/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/site/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php index 2ece6ac7b..0331ef580 100644 --- a/site/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ b/site/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php @@ -20,10 +20,7 @@ */ class TranslationDumperPass implements CompilerPassInterface { - /** - * @return void - */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('translation.writer')) { return; diff --git a/site/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/site/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php index 1baf9341e..28873d009 100644 --- a/site/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ b/site/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php @@ -21,10 +21,7 @@ */ class TranslationExtractorPass implements CompilerPassInterface { - /** - * @return void - */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('translation.extractor')) { return; diff --git a/site/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/site/vendor/symfony/translation/DependencyInjection/TranslatorPass.php index dd6ea3c83..948f378d6 100644 --- a/site/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +++ b/site/vendor/symfony/translation/DependencyInjection/TranslatorPass.php @@ -18,10 +18,7 @@ class TranslatorPass implements CompilerPassInterface { - /** - * @return void - */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('translator.default')) { return; diff --git a/site/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/site/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index 1756e3c8c..4f5fc2de0 100644 --- a/site/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/site/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -42,10 +42,7 @@ class TranslatorPathsPass extends AbstractRecursivePass */ private array $controllers = []; - /** - * @return void - */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('translator')) { return; diff --git a/site/vendor/symfony/translation/Dumper/CsvFileDumper.php b/site/vendor/symfony/translation/Dumper/CsvFileDumper.php index 8f5475259..60b744113 100644 --- a/site/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ b/site/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -40,10 +40,8 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra /** * Sets the delimiter and escape character for CSV. - * - * @return void */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"') + public function setCsvControl(string $delimiter = ';', string $enclosure = '"'): void { $this->delimiter = $delimiter; $this->enclosure = $enclosure; diff --git a/site/vendor/symfony/translation/Dumper/DumperInterface.php b/site/vendor/symfony/translation/Dumper/DumperInterface.php index 6bf42931e..c151de020 100644 --- a/site/vendor/symfony/translation/Dumper/DumperInterface.php +++ b/site/vendor/symfony/translation/Dumper/DumperInterface.php @@ -25,8 +25,6 @@ interface DumperInterface * Dumps the message catalogue. * * @param array $options Options that are used by the dumper - * - * @return void */ - public function dump(MessageCatalogue $messages, array $options = []); + public function dump(MessageCatalogue $messages, array $options = []): void; } diff --git a/site/vendor/symfony/translation/Dumper/FileDumper.php b/site/vendor/symfony/translation/Dumper/FileDumper.php index e30d4770e..3846e7380 100644 --- a/site/vendor/symfony/translation/Dumper/FileDumper.php +++ b/site/vendor/symfony/translation/Dumper/FileDumper.php @@ -27,25 +27,18 @@ abstract class FileDumper implements DumperInterface { /** * A template for the relative paths to files. - * - * @var string */ - protected $relativePathTemplate = '%domain%.%locale%.%extension%'; + protected string $relativePathTemplate = '%domain%.%locale%.%extension%'; /** * Sets the template for the relative paths to files. - * - * @return void */ - public function setRelativePathTemplate(string $relativePathTemplate) + public function setRelativePathTemplate(string $relativePathTemplate): void { $this->relativePathTemplate = $relativePathTemplate; } - /** - * @return void - */ - public function dump(MessageCatalogue $messages, array $options = []) + public function dump(MessageCatalogue $messages, array $options = []): void { if (!\array_key_exists('path', $options)) { throw new InvalidArgumentException('The file dumper needs a path option.'); diff --git a/site/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/site/vendor/symfony/translation/Dumper/IcuResFileDumper.php index 72c1ec089..e603ee8c4 100644 --- a/site/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ b/site/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -20,7 +20,7 @@ */ class IcuResFileDumper extends FileDumper { - protected $relativePathTemplate = '%domain%/%locale%.%extension%'; + protected string $relativePathTemplate = '%domain%/%locale%.%extension%'; public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { diff --git a/site/vendor/symfony/translation/Dumper/XliffFileDumper.php b/site/vendor/symfony/translation/Dumper/XliffFileDumper.php index 22f0227b9..d0f016b23 100644 --- a/site/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ b/site/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -214,7 +214,7 @@ private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ? return $dom->saveXML(); } - private function hasMetadataArrayInfo(string $key, array $metadata = null): bool + private function hasMetadataArrayInfo(string $key, ?array $metadata = null): bool { return is_iterable($metadata[$key] ?? null); } diff --git a/site/vendor/symfony/translation/Exception/IncompleteDsnException.php b/site/vendor/symfony/translation/Exception/IncompleteDsnException.php index cb0ce027e..b304bde01 100644 --- a/site/vendor/symfony/translation/Exception/IncompleteDsnException.php +++ b/site/vendor/symfony/translation/Exception/IncompleteDsnException.php @@ -13,7 +13,7 @@ class IncompleteDsnException extends InvalidArgumentException { - public function __construct(string $message, string $dsn = null, \Throwable $previous = null) + public function __construct(string $message, ?string $dsn = null, ?\Throwable $previous = null) { if ($dsn) { $message = sprintf('Invalid "%s" provider DSN: ', $dsn).$message; diff --git a/site/vendor/symfony/translation/Exception/MissingRequiredOptionException.php b/site/vendor/symfony/translation/Exception/MissingRequiredOptionException.php index 2b5f80806..46152e254 100644 --- a/site/vendor/symfony/translation/Exception/MissingRequiredOptionException.php +++ b/site/vendor/symfony/translation/Exception/MissingRequiredOptionException.php @@ -16,7 +16,7 @@ */ class MissingRequiredOptionException extends IncompleteDsnException { - public function __construct(string $option, string $dsn = null, \Throwable $previous = null) + public function __construct(string $option, ?string $dsn = null, ?\Throwable $previous = null) { $message = sprintf('The option "%s" is required but missing.', $option); diff --git a/site/vendor/symfony/translation/Exception/ProviderException.php b/site/vendor/symfony/translation/Exception/ProviderException.php index 65883f852..f2981f58b 100644 --- a/site/vendor/symfony/translation/Exception/ProviderException.php +++ b/site/vendor/symfony/translation/Exception/ProviderException.php @@ -21,7 +21,7 @@ class ProviderException extends RuntimeException implements ProviderExceptionInt private ResponseInterface $response; private string $debug; - public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) + public function __construct(string $message, ResponseInterface $response, int $code = 0, ?\Exception $previous = null) { $this->response = $response; $this->debug = $response->getInfo('debug') ?? ''; diff --git a/site/vendor/symfony/translation/Exception/UnsupportedSchemeException.php b/site/vendor/symfony/translation/Exception/UnsupportedSchemeException.php index a4d838581..8d3295184 100644 --- a/site/vendor/symfony/translation/Exception/UnsupportedSchemeException.php +++ b/site/vendor/symfony/translation/Exception/UnsupportedSchemeException.php @@ -35,7 +35,7 @@ class UnsupportedSchemeException extends LogicException ], ]; - public function __construct(Dsn $dsn, string $name = null, array $supported = []) + public function __construct(Dsn $dsn, ?string $name = null, array $supported = []) { $provider = $dsn->getScheme(); if (false !== $pos = strpos($provider, '+')) { diff --git a/site/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/site/vendor/symfony/translation/Extractor/AbstractFileExtractor.php index 4c088b94f..a6198feb0 100644 --- a/site/vendor/symfony/translation/Extractor/AbstractFileExtractor.php +++ b/site/vendor/symfony/translation/Extractor/AbstractFileExtractor.php @@ -55,13 +55,7 @@ protected function isFile(string $file): bool return true; } - /** - * @return bool - */ - abstract protected function canBeExtracted(string $file); + abstract protected function canBeExtracted(string $file): bool; - /** - * @return iterable - */ - abstract protected function extractFromDirectory(string|array $resource); + abstract protected function extractFromDirectory(string|array $resource): iterable; } diff --git a/site/vendor/symfony/translation/Extractor/ChainExtractor.php b/site/vendor/symfony/translation/Extractor/ChainExtractor.php index d36f7f385..ec9982da7 100644 --- a/site/vendor/symfony/translation/Extractor/ChainExtractor.php +++ b/site/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -29,28 +29,20 @@ class ChainExtractor implements ExtractorInterface /** * Adds a loader to the translation extractor. - * - * @return void */ - public function addExtractor(string $format, ExtractorInterface $extractor) + public function addExtractor(string $format, ExtractorInterface $extractor): void { $this->extractors[$format] = $extractor; } - /** - * @return void - */ - public function setPrefix(string $prefix) + public function setPrefix(string $prefix): void { foreach ($this->extractors as $extractor) { $extractor->setPrefix($prefix); } } - /** - * @return void - */ - public function extract(string|iterable $directory, MessageCatalogue $catalogue) + public function extract(string|iterable $directory, MessageCatalogue $catalogue): void { foreach ($this->extractors as $extractor) { $extractor->extract($directory, $catalogue); diff --git a/site/vendor/symfony/translation/Extractor/PhpAstExtractor.php b/site/vendor/symfony/translation/Extractor/PhpAstExtractor.php index 4dd7f41b2..06fc77de3 100644 --- a/site/vendor/symfony/translation/Extractor/PhpAstExtractor.php +++ b/site/vendor/symfony/translation/Extractor/PhpAstExtractor.php @@ -39,13 +39,18 @@ public function __construct( throw new \LogicException(sprintf('You cannot use "%s" as the "nikic/php-parser" package is not installed. Try running "composer require nikic/php-parser".', static::class)); } - $this->parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7); + $this->parser = (new ParserFactory())->createForHostVersion(); } public function extract(iterable|string $resource, MessageCatalogue $catalogue): void { foreach ($this->extractFiles($resource) as $file) { $traverser = new NodeTraverser(); + + // This is needed to resolve namespaces in class methods/constants. + $nameResolver = new NodeVisitor\NameResolver(); + $traverser->addVisitor($nameResolver); + /** @var AbstractVisitor&NodeVisitor $visitor */ foreach ($this->visitors as $visitor) { $visitor->initialize($catalogue, $file, $this->prefix); diff --git a/site/vendor/symfony/translation/Extractor/PhpExtractor.php b/site/vendor/symfony/translation/Extractor/PhpExtractor.php deleted file mode 100644 index 7ff27f7c8..000000000 --- a/site/vendor/symfony/translation/Extractor/PhpExtractor.php +++ /dev/null @@ -1,333 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated, use "%s" instead.', PhpExtractor::class, PhpAstExtractor::class); - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpExtractor extracts translation messages from a PHP template. - * - * @author Michel Salib - * - * @deprecated since Symfony 6.2, use the PhpAstExtractor instead - */ -class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface -{ - public const MESSAGE_TOKEN = 300; - public const METHOD_ARGUMENTS_TOKEN = 1000; - public const DOMAIN_TOKEN = 1001; - - /** - * Prefix for new found message. - */ - private string $prefix = ''; - - /** - * The sequence that captures translation messages. - */ - protected $sequences = [ - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - '\\', - 'Symfony', - '\\', - 'Component', - '\\', - 'Translation', - '\\', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - '\Symfony\Component\Translation\TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - '\\', - 'Symfony', - '\\', - 'Component', - '\\', - 'Translation', - '\\', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - '\Symfony\Component\Translation\TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 't', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 't', - '(', - self::MESSAGE_TOKEN, - ], - ]; - - /** - * @return void - */ - public function extract(string|iterable $resource, MessageCatalogue $catalog) - { - $files = $this->extractFiles($resource); - foreach ($files as $file) { - $this->parseTokens(token_get_all(file_get_contents($file)), $catalog, $file); - - gc_mem_caches(); - } - } - - /** - * @return void - */ - public function setPrefix(string $prefix) - { - $this->prefix = $prefix; - } - - /** - * Normalizes a token. - */ - protected function normalizeToken(mixed $token): ?string - { - if (isset($token[1]) && 'b"' !== $token) { - return $token[1]; - } - - return $token; - } - - /** - * Seeks to a non-whitespace token. - */ - private function seekToNextRelevantToken(\Iterator $tokenIterator): void - { - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if (\T_WHITESPACE !== $t[0]) { - break; - } - } - } - - private function skipMethodArgument(\Iterator $tokenIterator): void - { - $openBraces = 0; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - - if ('[' === $t[0] || '(' === $t[0]) { - ++$openBraces; - } - - if (']' === $t[0] || ')' === $t[0]) { - --$openBraces; - } - - if ((0 === $openBraces && ',' === $t[0]) || (-1 === $openBraces && ')' === $t[0])) { - break; - } - } - } - - /** - * Extracts the message from the iterator while the tokens - * match allowed message tokens. - */ - private function getValue(\Iterator $tokenIterator): string - { - $message = ''; - $docToken = ''; - $docPart = ''; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if ('.' === $t) { - // Concatenate with next token - continue; - } - if (!isset($t[1])) { - break; - } - - switch ($t[0]) { - case \T_START_HEREDOC: - $docToken = $t[1]; - break; - case \T_ENCAPSED_AND_WHITESPACE: - case \T_CONSTANT_ENCAPSED_STRING: - if ('' === $docToken) { - $message .= PhpStringTokenParser::parse($t[1]); - } else { - $docPart = $t[1]; - } - break; - case \T_END_HEREDOC: - if ($indentation = strspn($t[1], ' ')) { - $docPartWithLineBreaks = $docPart; - $docPart = ''; - - foreach (preg_split('~(\r\n|\n|\r)~', $docPartWithLineBreaks, -1, \PREG_SPLIT_DELIM_CAPTURE) as $str) { - if (\in_array($str, ["\r\n", "\n", "\r"], true)) { - $docPart .= $str; - } else { - $docPart .= substr($str, $indentation); - } - } - } - - $message .= PhpStringTokenParser::parseDocString($docToken, $docPart); - $docToken = ''; - $docPart = ''; - break; - case \T_WHITESPACE: - break; - default: - break 2; - } - } - - return $message; - } - - /** - * Extracts trans message from PHP tokens. - * - * @return void - */ - protected function parseTokens(array $tokens, MessageCatalogue $catalog, string $filename) - { - $tokenIterator = new \ArrayIterator($tokens); - - for ($key = 0; $key < $tokenIterator->count(); ++$key) { - foreach ($this->sequences as $sequence) { - $message = ''; - $domain = 'messages'; - $tokenIterator->seek($key); - - foreach ($sequence as $sequenceKey => $item) { - $this->seekToNextRelevantToken($tokenIterator); - - if ($this->normalizeToken($tokenIterator->current()) === $item) { - $tokenIterator->next(); - continue; - } elseif (self::MESSAGE_TOKEN === $item) { - $message = $this->getValue($tokenIterator); - - if (\count($sequence) === ($sequenceKey + 1)) { - break; - } - } elseif (self::METHOD_ARGUMENTS_TOKEN === $item) { - $this->skipMethodArgument($tokenIterator); - } elseif (self::DOMAIN_TOKEN === $item) { - $domainToken = $this->getValue($tokenIterator); - if ('' !== $domainToken) { - $domain = $domainToken; - } - - break; - } else { - break; - } - } - - if ($message) { - $catalog->set($message, $this->prefix.$message, $domain); - $metadata = $catalog->getMetadata($message, $domain) ?? []; - $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $filename); - $metadata['sources'][] = $normalizedFilename.':'.$tokens[$key][2]; - $catalog->setMetadata($message, $metadata, $domain); - break; - } - } - } - } - - /** - * @throws \InvalidArgumentException - */ - protected function canBeExtracted(string $file): bool - { - return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION); - } - - protected function extractFromDirectory(string|array $directory): iterable - { - if (!class_exists(Finder::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); - } - - $finder = new Finder(); - - return $finder->files()->name('*.php')->in($directory); - } -} diff --git a/site/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/site/vendor/symfony/translation/Extractor/PhpStringTokenParser.php deleted file mode 100644 index 3b854ce73..000000000 --- a/site/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated.', PhpStringTokenParser::class); - -/* - * The following is derived from code at http://github.com/nikic/PHP-Parser - * - * Copyright (c) 2011 by Nikita Popov - * - * Some rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * * The names of the contributors may not be used to endorse or - * promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @deprecated since Symfony 6.2 - */ -class PhpStringTokenParser -{ - protected static $replacements = [ - '\\' => '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Parses a string token. - * - * @param string $str String token content - */ - public static function parse(string $str): string - { - $bLength = 0; - if ('b' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences(substr($str, $bLength + 1, -1), '"'); - } - } - - /** - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param string|null $quote Quote type - */ - public static function parseEscapeSequences(string $str, string $quote = null): string - { - if (null !== $quote) { - $str = str_replace('\\'.$quote, $quote, $str); - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~', - [__CLASS__, 'parseCallback'], - $str - ); - } - - private static function parseCallback(array $matches): string - { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { - return \chr(hexdec($str)); - } else { - return \chr(octdec($str)); - } - } - - /** - * Parses a constant doc string. - * - * @param string $startToken Doc string start token content (<<getArgs() : $node->args; $argumentValues = []; @@ -119,6 +119,17 @@ private function getStringValue(Node $node): ?string return $node->expr->value; } + if ($node instanceof Node\Expr\ClassConstFetch) { + try { + $reflection = new \ReflectionClass($node->class->toString()); + $constant = $reflection->getReflectionConstant($node->name->toString()); + if (false !== $constant && \is_string($constant->getValue())) { + return $constant->getValue(); + } + } catch (\ReflectionException) { + } + } + return null; } } diff --git a/site/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php b/site/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php index 33dc8437a..00fb9eedc 100644 --- a/site/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php +++ b/site/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php @@ -32,6 +32,11 @@ public function beforeTraverse(array $nodes): ?Node } public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node { if (!$node instanceof Node\Expr\New_ && !$node instanceof Node\Attribute) { return null; @@ -42,7 +47,7 @@ public function enterNode(Node $node): ?Node return null; } - $parts = $className->parts; + $parts = $className->getParts(); $isConstraintClass = false; foreach ($parts as $part) { @@ -100,11 +105,6 @@ public function enterNode(Node $node): ?Node return null; } - public function leaveNode(Node $node): ?Node - { - return null; - } - public function afterTraverse(array $nodes): ?Node { return null; diff --git a/site/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php b/site/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php index 0b537baa2..53a6981a2 100644 --- a/site/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php +++ b/site/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php @@ -25,6 +25,11 @@ public function beforeTraverse(array $nodes): ?Node } public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node { if (!$node instanceof Node\Expr\MethodCall && !$node instanceof Node\Expr\FuncCall) { return null; @@ -53,11 +58,6 @@ public function enterNode(Node $node): ?Node return null; } - public function leaveNode(Node $node): ?Node - { - return null; - } - public function afterTraverse(array $nodes): ?Node { return null; diff --git a/site/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php b/site/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php index c1505a135..6bd8bb022 100644 --- a/site/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php +++ b/site/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php @@ -25,6 +25,11 @@ public function beforeTraverse(array $nodes): ?Node } public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node { if (!$node instanceof Node\Expr\New_) { return null; @@ -34,7 +39,7 @@ public function enterNode(Node $node): ?Node return null; } - if (!\in_array('TranslatableMessage', $className->parts, true)) { + if (!\in_array('TranslatableMessage', $className->getParts(), true)) { return null; } @@ -53,11 +58,6 @@ public function enterNode(Node $node): ?Node return null; } - public function leaveNode(Node $node): ?Node - { - return null; - } - public function afterTraverse(array $nodes): ?Node { return null; diff --git a/site/vendor/symfony/translation/Formatter/MessageFormatter.php b/site/vendor/symfony/translation/Formatter/MessageFormatter.php index 5e101aa43..d5255bdcb 100644 --- a/site/vendor/symfony/translation/Formatter/MessageFormatter.php +++ b/site/vendor/symfony/translation/Formatter/MessageFormatter.php @@ -28,7 +28,7 @@ class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterf /** * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization */ - public function __construct(TranslatorInterface $translator = null, IntlFormatterInterface $intlFormatter = null) + public function __construct(?TranslatorInterface $translator = null, ?IntlFormatterInterface $intlFormatter = null) { $this->translator = $translator ?? new IdentityTranslator(); $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); diff --git a/site/vendor/symfony/translation/Loader/CsvFileLoader.php b/site/vendor/symfony/translation/Loader/CsvFileLoader.php index 7f2f96be6..4eda9594d 100644 --- a/site/vendor/symfony/translation/Loader/CsvFileLoader.php +++ b/site/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -52,10 +52,8 @@ protected function loadResource(string $resource): array /** * Sets the delimiter, enclosure, and escape character for CSV. - * - * @return void */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') + public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\'): void { $this->delimiter = $delimiter; $this->enclosure = $enclosure; diff --git a/site/vendor/symfony/translation/Loader/IcuResFileLoader.php b/site/vendor/symfony/translation/Loader/IcuResFileLoader.php index 94d55b861..949dd9792 100644 --- a/site/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/site/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -70,7 +70,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages * @param array $messages Used internally for recursive calls * @param string|null $path Current path being parsed, used internally for recursive calls */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null): array + protected function flatten(\ResourceBundle $rb, array &$messages = [], ?string $path = null): array { foreach ($rb as $key => $value) { $nodePath = $path ? $path.'.'.$key : $key; diff --git a/site/vendor/symfony/translation/Loader/XliffFileLoader.php b/site/vendor/symfony/translation/Loader/XliffFileLoader.php index 34cad36c4..31b3251ba 100644 --- a/site/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/site/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -112,6 +112,10 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s continue; } + if (isset($translation->target) && 'needs-translation' === (string) $translation->target->attributes()['state']) { + continue; + } + $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; // If the xlf file has another encoding specified, try to convert it because // simple_xml will always return utf-8 encoded values @@ -191,7 +195,7 @@ private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, s /** * Convert a UTF8 string to the specified encoding. */ - private function utf8ToCharset(string $content, string $encoding = null): string + private function utf8ToCharset(string $content, ?string $encoding = null): string { if ('UTF-8' !== $encoding && !empty($encoding)) { return mb_convert_encoding($content, $encoding, 'UTF-8'); @@ -200,7 +204,7 @@ private function utf8ToCharset(string $content, string $encoding = null): string return $content; } - private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array + private function parseNotesMetadata(?\SimpleXMLElement $noteElement = null, ?string $encoding = null): array { $notes = []; diff --git a/site/vendor/symfony/translation/LoggingTranslator.php b/site/vendor/symfony/translation/LoggingTranslator.php index a7ad410a5..8c9b26463 100644 --- a/site/vendor/symfony/translation/LoggingTranslator.php +++ b/site/vendor/symfony/translation/LoggingTranslator.php @@ -37,7 +37,7 @@ public function __construct(TranslatorInterface $translator, LoggerInterface $lo $this->logger = $logger; } - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->log($id, $domain, $locale); @@ -45,10 +45,7 @@ public function trans(?string $id, array $parameters = [], string $domain = null return $trans; } - /** - * @return void - */ - public function setLocale(string $locale) + public function setLocale(string $locale): void { $prev = $this->translator->getLocale(); $this->translator->setLocale($locale); @@ -64,7 +61,7 @@ public function getLocale(): string return $this->translator->getLocale(); } - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -86,10 +83,7 @@ public function getFallbackLocales(): array return []; } - /** - * @return mixed - */ - public function __call(string $method, array $args) + public function __call(string $method, array $args): mixed { return $this->translator->{$method}(...$args); } diff --git a/site/vendor/symfony/translation/MessageCatalogue.php b/site/vendor/symfony/translation/MessageCatalogue.php index 379d947ce..f0cc6b321 100644 --- a/site/vendor/symfony/translation/MessageCatalogue.php +++ b/site/vendor/symfony/translation/MessageCatalogue.php @@ -55,7 +55,7 @@ public function getDomains(): array return array_values($domains); } - public function all(string $domain = null): array + public function all(?string $domain = null): array { if (null !== $domain) { // skip messages merge if intl-icu requested explicitly @@ -80,10 +80,7 @@ public function all(string $domain = null): array return $allMessages; } - /** - * @return void - */ - public function set(string $id, string $translation, string $domain = 'messages') + public function set(string $id, string $translation, string $domain = 'messages'): void { $this->add([$id => $translation], $domain); } @@ -123,20 +120,14 @@ public function get(string $id, string $domain = 'messages'): string return $id; } - /** - * @return void - */ - public function replace(array $messages, string $domain = 'messages') + public function replace(array $messages, string $domain = 'messages'): void { unset($this->messages[$domain], $this->messages[$domain.self::INTL_DOMAIN_SUFFIX]); $this->add($messages, $domain); } - /** - * @return void - */ - public function add(array $messages, string $domain = 'messages') + public function add(array $messages, string $domain = 'messages'): void { $altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX; foreach ($messages as $id => $message) { @@ -149,10 +140,7 @@ public function add(array $messages, string $domain = 'messages') } } - /** - * @return void - */ - public function addCatalogue(MessageCatalogueInterface $catalogue) + public function addCatalogue(MessageCatalogueInterface $catalogue): void { if ($catalogue->getLocale() !== $this->locale) { throw new LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s".', $catalogue->getLocale(), $this->locale)); @@ -181,10 +169,7 @@ public function addCatalogue(MessageCatalogueInterface $catalogue) } } - /** - * @return void - */ - public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) + public function addFallbackCatalogue(MessageCatalogueInterface $catalogue): void { // detect circular references $c = $catalogue; @@ -223,10 +208,7 @@ public function getResources(): array return array_values($this->resources); } - /** - * @return void - */ - public function addResource(ResourceInterface $resource) + public function addResource(ResourceInterface $resource): void { $this->resources[$resource->__toString()] = $resource; } @@ -250,18 +232,12 @@ public function getMetadata(string $key = '', string $domain = 'messages'): mixe return null; } - /** - * @return void - */ - public function setMetadata(string $key, mixed $value, string $domain = 'messages') + public function setMetadata(string $key, mixed $value, string $domain = 'messages'): void { $this->metadata[$domain][$key] = $value; } - /** - * @return void - */ - public function deleteMetadata(string $key = '', string $domain = 'messages') + public function deleteMetadata(string $key = '', string $domain = 'messages'): void { if ('' == $domain) { $this->metadata = []; @@ -291,18 +267,12 @@ public function getCatalogueMetadata(string $key = '', string $domain = 'message return null; } - /** - * @return void - */ - public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages') + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'): void { $this->catalogueMetadata[$domain][$key] = $value; } - /** - * @return void - */ - public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages') + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'): void { if (!$domain) { $this->catalogueMetadata = []; diff --git a/site/vendor/symfony/translation/MessageCatalogueInterface.php b/site/vendor/symfony/translation/MessageCatalogueInterface.php index ed819f155..5d6356053 100644 --- a/site/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/site/vendor/symfony/translation/MessageCatalogueInterface.php @@ -37,7 +37,7 @@ public function getDomains(): array; * * If $domain is null, it returns all messages. */ - public function all(string $domain = null): array; + public function all(?string $domain = null): array; /** * Sets a message translation. @@ -45,10 +45,8 @@ public function all(string $domain = null): array; * @param string $id The message id * @param string $translation The messages translation * @param string $domain The domain name - * - * @return void */ - public function set(string $id, string $translation, string $domain = 'messages'); + public function set(string $id, string $translation, string $domain = 'messages'): void; /** * Checks if a message has a translation. @@ -79,39 +77,31 @@ public function get(string $id, string $domain = 'messages'): string; * * @param array $messages An array of translations * @param string $domain The domain name - * - * @return void */ - public function replace(array $messages, string $domain = 'messages'); + public function replace(array $messages, string $domain = 'messages'): void; /** * Adds translations for a given domain. * * @param array $messages An array of translations * @param string $domain The domain name - * - * @return void */ - public function add(array $messages, string $domain = 'messages'); + public function add(array $messages, string $domain = 'messages'): void; /** * Merges translations from the given Catalogue into the current one. * * The two catalogues must have the same locale. - * - * @return void */ - public function addCatalogue(self $catalogue); + public function addCatalogue(self $catalogue): void; /** * Merges translations from the given Catalogue into the current one * only when the translation does not exist. * * This is used to provide default translations when they do not exist for the current locale. - * - * @return void */ - public function addFallbackCatalogue(self $catalogue); + public function addFallbackCatalogue(self $catalogue): void; /** * Gets the fallback catalogue. @@ -127,8 +117,6 @@ public function getResources(): array; /** * Adds a resource for this collection. - * - * @return void */ - public function addResource(ResourceInterface $resource); + public function addResource(ResourceInterface $resource): void; } diff --git a/site/vendor/symfony/translation/MetadataAwareInterface.php b/site/vendor/symfony/translation/MetadataAwareInterface.php index 39e5326c3..12e4f33ba 100644 --- a/site/vendor/symfony/translation/MetadataAwareInterface.php +++ b/site/vendor/symfony/translation/MetadataAwareInterface.php @@ -31,18 +31,14 @@ public function getMetadata(string $key = '', string $domain = 'messages'): mixe /** * Adds metadata to a message domain. - * - * @return void */ - public function setMetadata(string $key, mixed $value, string $domain = 'messages'); + public function setMetadata(string $key, mixed $value, string $domain = 'messages'): void; /** * Deletes metadata for the given key and domain. * * Passing an empty domain will delete all metadata. Passing an empty key will * delete all metadata for the given domain. - * - * @return void */ - public function deleteMetadata(string $key = '', string $domain = 'messages'); + public function deleteMetadata(string $key = '', string $domain = 'messages'): void; } diff --git a/site/vendor/symfony/translation/Provider/Dsn.php b/site/vendor/symfony/translation/Provider/Dsn.php index af75cb3ae..1d90e27f9 100644 --- a/site/vendor/symfony/translation/Provider/Dsn.php +++ b/site/vendor/symfony/translation/Provider/Dsn.php @@ -33,25 +33,25 @@ public function __construct(#[\SensitiveParameter] string $dsn) { $this->originalDsn = $dsn; - if (false === $parsedDsn = parse_url($dsn)) { + if (false === $params = parse_url($dsn)) { throw new InvalidArgumentException('The translation provider DSN is invalid.'); } - if (!isset($parsedDsn['scheme'])) { + if (!isset($params['scheme'])) { throw new InvalidArgumentException('The translation provider DSN must contain a scheme.'); } - $this->scheme = $parsedDsn['scheme']; + $this->scheme = $params['scheme']; - if (!isset($parsedDsn['host'])) { + if (!isset($params['host'])) { throw new InvalidArgumentException('The translation provider DSN must contain a host (use "default" by default).'); } - $this->host = $parsedDsn['host']; + $this->host = $params['host']; - $this->user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null; - $this->password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null; - $this->port = $parsedDsn['port'] ?? null; - $this->path = $parsedDsn['path'] ?? null; - parse_str($parsedDsn['query'] ?? '', $this->options); + $this->user = '' !== ($params['user'] ?? '') ? rawurldecode($params['user']) : null; + $this->password = '' !== ($params['pass'] ?? '') ? rawurldecode($params['pass']) : null; + $this->port = $params['port'] ?? null; + $this->path = $params['path'] ?? null; + parse_str($params['query'] ?? '', $this->options); } public function getScheme(): string @@ -74,7 +74,7 @@ public function getPassword(): ?string return $this->password; } - public function getPort(int $default = null): ?int + public function getPort(?int $default = null): ?int { return $this->port ?? $default; } diff --git a/site/vendor/symfony/translation/PseudoLocalizationTranslator.php b/site/vendor/symfony/translation/PseudoLocalizationTranslator.php index 0207e9997..f26909f5e 100644 --- a/site/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/site/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -83,7 +83,7 @@ public function __construct(TranslatorInterface $translator, array $options = [] $this->localizableHTMLAttributes = $options['localizable_html_attributes'] ?? []; } - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = ''; $visibleText = ''; @@ -120,7 +120,7 @@ private function getParts(string $originalTrans): array return [[true, true, $originalTrans]]; } - $html = mb_encode_numericentity($originalTrans, [0x80, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); + $html = mb_encode_numericentity($originalTrans, [0x80, 0x10FFFF, 0, 0x1FFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); $useInternalErrors = libxml_use_internal_errors(true); diff --git a/site/vendor/symfony/translation/Reader/TranslationReader.php b/site/vendor/symfony/translation/Reader/TranslationReader.php index 01408d4dc..928e2c562 100644 --- a/site/vendor/symfony/translation/Reader/TranslationReader.php +++ b/site/vendor/symfony/translation/Reader/TranslationReader.php @@ -33,18 +33,13 @@ class TranslationReader implements TranslationReaderInterface * Adds a loader to the translation extractor. * * @param string $format The format of the loader - * - * @return void */ - public function addLoader(string $format, LoaderInterface $loader) + public function addLoader(string $format, LoaderInterface $loader): void { $this->loaders[$format] = $loader; } - /** - * @return void - */ - public function read(string $directory, MessageCatalogue $catalogue) + public function read(string $directory, MessageCatalogue $catalogue): void { if (!is_dir($directory)) { return; diff --git a/site/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/site/vendor/symfony/translation/Reader/TranslationReaderInterface.php index ea74dc23f..bab6e59be 100644 --- a/site/vendor/symfony/translation/Reader/TranslationReaderInterface.php +++ b/site/vendor/symfony/translation/Reader/TranslationReaderInterface.php @@ -22,8 +22,6 @@ interface TranslationReaderInterface { /** * Reads translation messages from a directory to the catalogue. - * - * @return void */ - public function read(string $directory, MessageCatalogue $catalogue); + public function read(string $directory, MessageCatalogue $catalogue): void; } diff --git a/site/vendor/symfony/translation/Resources/functions.php b/site/vendor/symfony/translation/Resources/functions.php index 901d2f87e..0d2a037a2 100644 --- a/site/vendor/symfony/translation/Resources/functions.php +++ b/site/vendor/symfony/translation/Resources/functions.php @@ -15,7 +15,7 @@ /** * @author Nate Wiebe */ - function t(string $message, array $parameters = [], string $domain = null): TranslatableMessage + function t(string $message, array $parameters = [], ?string $domain = null): TranslatableMessage { return new TranslatableMessage($message, $parameters, $domain); } diff --git a/site/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/site/vendor/symfony/translation/Test/ProviderFactoryTestCase.php index 110ea3d7a..95ffcb1e5 100644 --- a/site/vendor/symfony/translation/Test/ProviderFactoryTestCase.php +++ b/site/vendor/symfony/translation/Test/ProviderFactoryTestCase.php @@ -90,7 +90,7 @@ public function testCreate(string $expected, string $dsn) /** * @dataProvider unsupportedSchemeProvider */ - public function testUnsupportedSchemeException(string $dsn, string $message = null) + public function testUnsupportedSchemeException(string $dsn, ?string $message = null) { $factory = $this->createFactory(); @@ -107,7 +107,7 @@ public function testUnsupportedSchemeException(string $dsn, string $message = nu /** * @dataProvider incompleteDsnProvider */ - public function testIncompleteDsnException(string $dsn, string $message = null) + public function testIncompleteDsnException(string $dsn, ?string $message = null) { $factory = $this->createFactory(); diff --git a/site/vendor/symfony/translation/TranslatableMessage.php b/site/vendor/symfony/translation/TranslatableMessage.php index 91d4c1941..c591e68c2 100644 --- a/site/vendor/symfony/translation/TranslatableMessage.php +++ b/site/vendor/symfony/translation/TranslatableMessage.php @@ -23,7 +23,7 @@ class TranslatableMessage implements TranslatableInterface private array $parameters; private ?string $domain; - public function __construct(string $message, array $parameters = [], string $domain = null) + public function __construct(string $message, array $parameters = [], ?string $domain = null) { $this->message = $message; $this->parameters = $parameters; @@ -50,7 +50,7 @@ public function getDomain(): ?string return $this->domain; } - public function trans(TranslatorInterface $translator, string $locale = null): string + public function trans(TranslatorInterface $translator, ?string $locale = null): string { return $translator->trans($this->getMessage(), array_map( static fn ($parameter) => $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter, diff --git a/site/vendor/symfony/translation/Translator.php b/site/vendor/symfony/translation/Translator.php index 132138e92..57bef2e04 100644 --- a/site/vendor/symfony/translation/Translator.php +++ b/site/vendor/symfony/translation/Translator.php @@ -36,7 +36,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * @var MessageCatalogueInterface[] */ - protected $catalogues = []; + protected array $catalogues = []; private string $locale; @@ -69,7 +69,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * @throws InvalidArgumentException If a locale contains invalid characters */ - public function __construct(string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = []) + public function __construct(string $locale, ?MessageFormatterInterface $formatter = null, ?string $cacheDir = null, bool $debug = false, array $cacheVary = []) { $this->setLocale($locale); @@ -80,10 +80,7 @@ public function __construct(string $locale, MessageFormatterInterface $formatter $this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface; } - /** - * @return void - */ - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void { $this->configCacheFactory = $configCacheFactory; } @@ -92,10 +89,8 @@ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFa * Adds a Loader. * * @param string $format The name of the loader (@see addResource()) - * - * @return void */ - public function addLoader(string $format, LoaderInterface $loader) + public function addLoader(string $format, LoaderInterface $loader): void { $this->loaders[$format] = $loader; } @@ -106,11 +101,9 @@ public function addLoader(string $format, LoaderInterface $loader) * @param string $format The name of the loader (@see addLoader()) * @param mixed $resource The resource name * - * @return void - * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function addResource(string $format, mixed $resource, string $locale, string $domain = null) + public function addResource(string $format, mixed $resource, string $locale, ?string $domain = null): void { $domain ??= 'messages'; @@ -126,10 +119,7 @@ public function addResource(string $format, mixed $resource, string $locale, str } } - /** - * @return void - */ - public function setLocale(string $locale) + public function setLocale(string $locale): void { $this->assertValidLocale($locale); $this->locale = $locale; @@ -145,11 +135,9 @@ public function getLocale(): string * * @param string[] $locales * - * @return void - * * @throws InvalidArgumentException If a locale contains invalid characters */ - public function setFallbackLocales(array $locales) + public function setFallbackLocales(array $locales): void { // needed as the fallback locales are linked to the already loaded catalogues $this->catalogues = []; @@ -171,7 +159,7 @@ public function getFallbackLocales(): array return $this->fallbackLocales; } - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { if (null === $id || '' === $id) { return ''; @@ -203,7 +191,7 @@ public function trans(?string $id, array $parameters = [], string $domain = null return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters); } - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { if (!$locale) { $locale = $this->getLocale(); @@ -233,10 +221,7 @@ protected function getLoaders(): array return $this->loaders; } - /** - * @return void - */ - protected function loadCatalogue(string $locale) + protected function loadCatalogue(string $locale): void { if (null === $this->cacheDir) { $this->initializeCatalogue($locale); @@ -245,10 +230,7 @@ protected function loadCatalogue(string $locale) } } - /** - * @return void - */ - protected function initializeCatalogue(string $locale) + protected function initializeCatalogue(string $locale): void { $this->assertValidLocale($locale); @@ -384,10 +366,7 @@ private function loadFallbackCatalogues(string $locale): void } } - /** - * @return array - */ - protected function computeFallbackLocales(string $locale) + protected function computeFallbackLocales(string $locale): array { $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); @@ -431,11 +410,9 @@ protected function computeFallbackLocales(string $locale) /** * Asserts that the locale is valid, throws an Exception if not. * - * @return void - * * @throws InvalidArgumentException If the locale contains invalid characters */ - protected function assertValidLocale(string $locale) + protected function assertValidLocale(string $locale): void { if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); diff --git a/site/vendor/symfony/translation/TranslatorBag.php b/site/vendor/symfony/translation/TranslatorBag.php index 84275ee14..3b47aecee 100644 --- a/site/vendor/symfony/translation/TranslatorBag.php +++ b/site/vendor/symfony/translation/TranslatorBag.php @@ -35,7 +35,7 @@ public function addBag(TranslatorBagInterface $bag): void } } - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { if (null === $locale || !isset($this->catalogues[$locale])) { $this->catalogues[$locale] = new MessageCatalogue($locale); diff --git a/site/vendor/symfony/translation/TranslatorBagInterface.php b/site/vendor/symfony/translation/TranslatorBagInterface.php index a787acf12..365d1f13b 100644 --- a/site/vendor/symfony/translation/TranslatorBagInterface.php +++ b/site/vendor/symfony/translation/TranslatorBagInterface.php @@ -25,7 +25,7 @@ interface TranslatorBagInterface * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface; + public function getCatalogue(?string $locale = null): MessageCatalogueInterface; /** * Returns all catalogues of the instance. diff --git a/site/vendor/symfony/translation/Writer/TranslationWriter.php b/site/vendor/symfony/translation/Writer/TranslationWriter.php index 61e03cb0e..21604ef18 100644 --- a/site/vendor/symfony/translation/Writer/TranslationWriter.php +++ b/site/vendor/symfony/translation/Writer/TranslationWriter.php @@ -30,10 +30,8 @@ class TranslationWriter implements TranslationWriterInterface /** * Adds a dumper to the writer. - * - * @return void */ - public function addDumper(string $format, DumperInterface $dumper) + public function addDumper(string $format, DumperInterface $dumper): void { $this->dumpers[$format] = $dumper; } @@ -52,11 +50,9 @@ public function getFormats(): array * @param string $format The format to use to dump the messages * @param array $options Options that are passed to the dumper * - * @return void - * * @throws InvalidArgumentException */ - public function write(MessageCatalogue $catalogue, string $format, array $options = []) + public function write(MessageCatalogue $catalogue, string $format, array $options = []): void { if (!isset($this->dumpers[$format])) { throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format)); diff --git a/site/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/site/vendor/symfony/translation/Writer/TranslationWriterInterface.php index 5ebb9794a..b3062827b 100644 --- a/site/vendor/symfony/translation/Writer/TranslationWriterInterface.php +++ b/site/vendor/symfony/translation/Writer/TranslationWriterInterface.php @@ -27,9 +27,7 @@ interface TranslationWriterInterface * @param string $format The format to use to dump the messages * @param array $options Options that are passed to the dumper * - * @return void - * * @throws InvalidArgumentException */ - public function write(MessageCatalogue $catalogue, string $format, array $options = []); + public function write(MessageCatalogue $catalogue, string $format, array $options = []): void; } diff --git a/site/vendor/symfony/translation/composer.json b/site/vendor/symfony/translation/composer.json index 32ab49a70..b793e4c98 100644 --- a/site/vendor/symfony/translation/composer.json +++ b/site/vendor/symfony/translation/composer.json @@ -16,35 +16,34 @@ } ], "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "nikic/php-parser": "^4.18|^5.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/routing": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/yaml": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4", + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/http-kernel": "<5.4", + "symfony/http-kernel": "<6.4", "symfony/service-contracts": "<2.5", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4", - "symfony/console": "<5.4" + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4", + "symfony/console": "<6.4" }, "provide": { "symfony/translation-implementation": "2.3|3.0" diff --git a/site/vendor/symfony/var-exporter/Exception/ClassNotFoundException.php b/site/vendor/symfony/var-exporter/Exception/ClassNotFoundException.php index 4cebe44b0..379a76517 100644 --- a/site/vendor/symfony/var-exporter/Exception/ClassNotFoundException.php +++ b/site/vendor/symfony/var-exporter/Exception/ClassNotFoundException.php @@ -13,7 +13,7 @@ class ClassNotFoundException extends \Exception implements ExceptionInterface { - public function __construct(string $class, \Throwable $previous = null) + public function __construct(string $class, ?\Throwable $previous = null) { parent::__construct(sprintf('Class "%s" not found.', $class), 0, $previous); } diff --git a/site/vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php b/site/vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php index 771ee612d..b9ba225d8 100644 --- a/site/vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php +++ b/site/vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php @@ -13,7 +13,7 @@ class NotInstantiableTypeException extends \Exception implements ExceptionInterface { - public function __construct(string $type, \Throwable $previous = null) + public function __construct(string $type, ?\Throwable $previous = null) { parent::__construct(sprintf('Type "%s" is not instantiable.', $type), 0, $previous); } diff --git a/site/vendor/symfony/var-exporter/LazyGhostTrait.php b/site/vendor/symfony/var-exporter/LazyGhostTrait.php index 539cf3e59..b9b77e73d 100644 --- a/site/vendor/symfony/var-exporter/LazyGhostTrait.php +++ b/site/vendor/symfony/var-exporter/LazyGhostTrait.php @@ -31,7 +31,7 @@ trait LazyGhostTrait * that the initializer doesn't initialize, if any * @param static|null $instance */ - public static function createLazyGhost(\Closure $initializer, array $skippedProperties = null, object $instance = null): static + public static function createLazyGhost(\Closure $initializer, ?array $skippedProperties = null, ?object $instance = null): static { if (self::class !== $class = $instance ? $instance::class : static::class) { $skippedProperties["\0".self::class."\0lazyObjectState"] = true; diff --git a/site/vendor/symfony/var-exporter/LazyProxyTrait.php b/site/vendor/symfony/var-exporter/LazyProxyTrait.php index d683ec3f1..4dd435bcd 100644 --- a/site/vendor/symfony/var-exporter/LazyProxyTrait.php +++ b/site/vendor/symfony/var-exporter/LazyProxyTrait.php @@ -27,7 +27,7 @@ trait LazyProxyTrait * @param \Closure():object $initializer Returns the proxied object * @param static|null $instance */ - public static function createLazyProxy(\Closure $initializer, object $instance = null): static + public static function createLazyProxy(\Closure $initializer, ?object $instance = null): static { if (self::class !== $class = $instance ? $instance::class : static::class) { $skippedProperties = ["\0".self::class."\0lazyObjectState" => true]; diff --git a/site/vendor/symfony/var-exporter/ProxyHelper.php b/site/vendor/symfony/var-exporter/ProxyHelper.php index 9cfd7b92b..b6792ad1d 100644 --- a/site/vendor/symfony/var-exporter/ProxyHelper.php +++ b/site/vendor/symfony/var-exporter/ProxyHelper.php @@ -213,7 +213,7 @@ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class); EOPHP; } - public static function exportSignature(\ReflectionFunctionAbstract $function, bool $withParameterTypes = true, string &$args = null): string + public static function exportSignature(\ReflectionFunctionAbstract $function, bool $withParameterTypes = true, ?string &$args = null): string { $byRefIndex = 0; $args = ''; @@ -270,7 +270,7 @@ public static function exportSignature(\ReflectionFunctionAbstract $function, bo return $signature; } - public static function exportType(\ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionParameter $owner, bool $noBuiltin = false, \ReflectionType $type = null): ?string + public static function exportType(\ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionParameter $owner, bool $noBuiltin = false, ?\ReflectionType $type = null): ?string { if (!$type ??= $owner instanceof \ReflectionFunctionAbstract ? $owner->getReturnType() : $owner->getType()) { return null; diff --git a/site/vendor/symfony/var-exporter/VarExporter.php b/site/vendor/symfony/var-exporter/VarExporter.php index b5ce3ae9e..22e9b5152 100644 --- a/site/vendor/symfony/var-exporter/VarExporter.php +++ b/site/vendor/symfony/var-exporter/VarExporter.php @@ -37,7 +37,7 @@ final class VarExporter * * @throws ExceptionInterface When the provided value cannot be serialized */ - public static function export(mixed $value, bool &$isStaticValue = null, array &$foundClasses = []): string + public static function export(mixed $value, ?bool &$isStaticValue = null, array &$foundClasses = []): string { $isStaticValue = true;